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

ReadOnly grid doesn''t allow selection in the ComboCell

I have a read only GridControl. I am implementing the filter feature, so that user cna select items from a combo box and data will be filtered based on the selection in the combo. gridControl1.ColStyles[1].CellValueType = typeof(string); gridControl1[1, 1].CellType = "ComboBox"; gridControl1[1, 1].ChoiceList = GetNames(); gridControl1[1, 1].CellValue = "test"; //gridControl1[1, 1].ReadOnly = true; If I make the grid readonly, when the user select any item in the combo box and navigate away from the combo, the selection is not retained in the cell. Do I need to capture any event and set the Text of the combo cell explicitely ? (This issue occurs only if the grid is readonly.)

2 Replies

Administrator July 23, 2004 01:46 PM UTC

If you want to change the value of the combobox cell (and it sounds like you do), then you will have to turn off the ReadOnly for this cell. Is it that you want to force your users to select something from the combobox, and not let them arbitrary type values into the cell? If so, try setting style.DropDownStyle to exclusive to see if that will do what you want.

TJ Tony John July 23, 2004 02:53 PM UTC

Thanks for the info. But it didn''t work for me if the grid itself is ReadOnly. So I had to do the following work around: Set grid.ReadOnly = false and make all other cells ReadOnly = true to avoid editing the cells by user. Thanks. >If you want to change the value of the combobox cell (and it sounds like you do), then you will have to turn off the ReadOnly for this cell. > >Is it that you want to force your users to select something from the combobox, and not let them arbitrary type values into the cell? If so, try setting style.DropDownStyle to exclusive to see if that will do what you want. >
Loader.
Live Chat Icon For mobile
Up arrow icon