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. Image for the cookie policy date

Focus on read-only cell in GDBG

Hi, I have read-only columns in my grid. when the user click on read only column, grid allowm them to type one character. How to avoid this? If i use the following then user doesn’t see the focus on the cell private void gdbgMeritSummaryGrid_CurrentCellActivating_1(object sender, Syncfusion.Windows.Forms.Grid.GridCurrentCellActivatingEventArgs e) { e.ColIndex = 0; } Thanks

7 Replies

AD Administrator Syncfusion Team May 2, 2005 02:25 PM

What version of the grid you using? This is not a known problem in the recent releases provided you are setting the ReadOnly property of the GridBoundColumn.StyleInfo object for the columns. If you want to try to work around this problem in the version you are using, then you can subscribe to teh CurrentCellStartEditing event, and there set e.Cancel = true if grid.CurrentCell.ColIndex points to a column that you want to be readonly.

AD Administrator Syncfusion Team May 2, 2005 03:27 PM

I am using the version # I am using the following code to make column readonly // settting columns readonly foreach (GridBoundColumn column in gdbgMeritSummaryGrid.GridBoundColumns) { column.ReadOnly = true; } Please let me know if there is something that i need to do except using other solution suggested by you. thanks thanks

AD Administrator Syncfusion Team May 2, 2005 05:03 PM

Where are you doing that code? I tried it in Form.Load, and did not see the problem you described. Here is the sample I tried. http://www.syncfusion.com/Support/user/uploads/GBDG_Readonly_239fb828.zip Do you see the problem in this sample? Can you upload a sample showing the problem?

AD Administrator Syncfusion Team May 2, 2005 06:06 PM

I am also doing it in formload event. AS per your suggestion i did coding in CurrentCellStartEditing event and it is working. thanks

TA Tom Abraham May 23, 2005 03:32 PM

I have the same issue in GridControl. In form load, I set _grid.ColStyles(1).ReadOnly = True. However, I can type a character into the "read only" cells that is not saved when I leave the cell. Tom

AD Administrator Syncfusion Team May 23, 2005 04:56 PM

This is a defect in Is that the version you are using? Until the next release, you can use the CurrentCellStartEditing event to avoid this problem.

TA Tom Abraham May 24, 2005 03:52 PM

Yes, I''m using

Live Chat Icon For mobile
Up arrow icon