PushButton Cell Type in GridGrouping Control

Hi,

I have made one of my column's cellType as PushButton in my Grid Grouping Control.

Now, I have a requirement to change the Color of my push Button programatically for each row.

Kindly, let me know how to achieve this..

Thanks,




1 Reply

JJ Jisha Joy Syncfusion Team October 7, 2008 12:27 PM UTC


Hi Ankit,


Thank you for your interest in Syncfusion Products.

This can be achieved by handling the TableControlDrawCellButtonBackground event. please refer the code:

void gridGroupingControl1_TableControlDrawCellButtonBackground(object sender, Syncfusion.Windows.Forms.Grid.Grouping.GridTableControlDrawCellButtonBackgroundEventArgs e)
{
if (e.Inner.Style.CellType == "PushButton")
{
e.Inner.Graphics.FillRectangle(Brushes.LightGray, e.Inner.Bounds);
e.Inner.Cancel = true;

}

}

Kindly try this and let me know if this helps.
Regards,
Jisha


Loader.
Up arrow icon