Change cell selection border for static or disabled cells/records

The default cell selection border for active cell is a black border.

Is there a way, either thru conditional format or querycellstyleinfo to maybe automatically change the border to gray at runtime so that users know that the cell is not editable or whatever?

1 Reply

AD Administrator Syncfusion Team September 29, 2006 05:53 AM UTC

Hi James,

Use the TableOptions.ListBoxSelectionOutlineBorder property to specify a border that should be drawn around a block of selected records. Also handle the TableControlPrepareviewStyleInfo event to set the border style of the currentCell in a grid.

//Set the border style of selected records.
this.grid.TableOptions.ListBoxSelectionOutlineBorder = new GridBorder(GridBorderStyle.Solid, Color.Red, GridBorderWeight.Medium);

private void gridTableControlPrepareViewStyleInfo(object sender, GridTableControlPrepareViewStyleInfoEventArgs e)
{
GridGroupingControl grid = sender as GridGroupingControl;
GridTableControl tc = e.TableControl;
GridCurrentCell cc = tc.CurrentCell;

if( e.Inner.RowIndex == cc.RowIndex && e.Inner.ColIndex == cc.ColIndex )
{
e.Inner.Style.Borders.All = grid.TableOptions.ListBoxSelectionOutlineBorder;
}
}

Sample: http://www.syncfusion.com/Support/user/uploads/SelectionBorderColor_beba6b.zip

Best Regards,
Haneef

Loader.
Up arrow icon