Using the TableControlCurrentCellActivating event to make the row a solid blue color when selected.

I copied a example from the knowledge base on making a whole row a solid blue color if the user clicks on one of its cell.

The code I copied is:
private void grdSavedPlans_TableControlCurrentCellActivating(object sender, Syncfusion.Windows.Forms.Grid.Grouping.GridTableControlCurrentCellActivatingEventArgs e)
{

e.Inner.ColIndex = 0;
}

This works great....but if you add a filter bar and allow filtering the blue bar will vanish if the user tries to filter. Is there a way to keep the blue bar there is the user uses the filter bar?


3 Replies

JJ Jisha Joy Syncfusion Team October 11, 2010 12:16 PM UTC

Hi David,

Please try this code snippet to highlight any record in grid.

private void gridGroupingControl1_QueryCellStyleInfo(object sender, Syncfusion.Windows.Forms.Grid.Grouping.GridTableCellStyleInfoEventArgs e)
{
GridCurrentCell cc=this.gridGroupingControl1.TableControl.CurrentCell;
if(e.TableCellIdentity.RowIndex > 0 && e.TableCellIdentity.ColIndex > 0 && cc.HasCurrentCellAt(e.TableCellIdentity.RowIndex))
{
e.Style.BackColor = Color.Pink;
e.Style.TextColor = Color.SteelBlue;
}


Regards,
Jisha



DM David Mecteaux October 11, 2010 03:06 PM UTC

That worked great!
Many thanks!



JJ Jisha Joy Syncfusion Team October 12, 2010 05:26 AM UTC

Hi David,

Thank you for your update.

Regards,
Jisha



Loader.
Up arrow icon