答案 0 :(得分:1)
您可以像这样处理ViewCellFormatting事件处理程序。我不确定何时应该是在摘要单元格中添加新按钮元素的最佳时间,但检查子项的数字可确保元素在开头只添加一次。或者,您可以将图像放在当前摘要单元格元素中,但推送效果将不可用。
private void RadGridView1_ViewCellFormatting(object sender, CellFormattingEventArgs e)
{
if (e.CellElement.ColumnInfo.Name == "V" && e.CellElement is GridSummaryCellElement)
{
// adding a new button element
if (e.CellElement.Children.Count == 0)
{
var element = new RadButtonElement();
element.Margin = new Padding(12, 0, 12, 0);
element.ImageAlignment = ContentAlignment.MiddleCenter;
element.Alignment = ContentAlignment.MiddleCenter;
e.CellElement.Children.Add(element);
}
// or setting an image to the current element
//e.CellElement.Image = Properties.Resources.FilterImage;
}
else
{
e.CellElement.ResetValue(LightVisualElement.ForeColorProperty, ValueResetFlags.Local);
e.CellElement.ResetValue(LightVisualElement.TextAlignmentProperty, ValueResetFlags.Local);
e.CellElement.ResetValue(LightVisualElement.FontProperty, ValueResetFlags.Local);
}
}