You can handle ViewCellFormatting event handler like this. I am not certain when should be the best time to add a new button element inside the summary cell, but the check for children's number ensures that the element will be added only once at the beginning. Alternatively you can just place an image in the current summary cell element, but the pushing effect will not be available.
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);
}
}
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.