GridDataBoundGrid default Currentcell Border

Hello,

I am using a GridDataBoundGrid. The default currentcell(rowindex = 1, columnindex = 1) is always having a border displayed.This is not desirable as even when this cell is set to be readonly it is possible to edit the contents of this cell.Moreover I do not want any cell in my datagrid to have a border appearance.Is there a way I can set this borderstyle to none?


1 Reply

AD Administrator Syncfusion Team April 15, 2008 12:29 PM UTC


Hi Keshav

Thanks for the interest in Syncfusion products.

If your intention is to remove the selected cell border for the cell(rowindex = 1, columnindex = 1) when the application run, you can set CurrentCell.MoveTo(-1, -1). And if you want to set the set the ReadOnly to this cell, you can handle PrepareViewStyleInfo event. Please refer the code snippet below.


this.gridDataBoundGrid1.CurrentCell.MoveTo(-1, -1);

private void gridDataBoundGrid1_PrepareViewStyleInfo(object sender, private void gridDataBoundGrid1_PrepareViewStyleInfo(object sender, Syncfusion.Windows.Forms.Grid.GridPrepareViewStyleInfoEventArgs e)
{
if (e.RowIndex == 1 && e.ColIndex == 1)
{
e.Style.ReadOnly = true; }
}


Please refer the sample in the below link that illustrates the above.

http://websamples.syncfusion.com/samples/Grid.Windows/I72929/main.htm

Please let me know if this is not what you needed.

Regards,
Asem.



Loader.
Up arrow icon