We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy.
Unfortunately, activation email could not send to your email. Please try again.

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

Thread ID:

Created:

Updated:

Platform:

Replies:

96840 Oct 8,2010 04:57 PM Oct 12,2010 01:26 AM Windows Forms 3
loading
Tags: GridControl
David Mecteaux
Asked On October 8, 2010 04:57 PM

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?


Jisha Joy [Syncfusion]
Replied On October 11, 2010 08:16 AM

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


David Mecteaux
Replied On October 11, 2010 11:06 AM

That worked great!
Many thanks!


Jisha Joy [Syncfusion]
Replied On October 12, 2010 01:26 AM

Hi David,

Thank you for your update.

Regards,
Jisha



CONFIRMATION

This post will be permanently deleted. Are you sure you want to continue?

Sorry, An error occured while processing your request. Please try again later.

You are using an outdated version of Internet Explorer that may not display all features of this and other websites. Upgrade to Internet Explorer 8 or newer for a better experience.

;