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

Automatic row selection

We are using GridDataBoundGrid control. When the grid shows us (on an undocked form) at times, any of the rows of the grid gets automatically selected(shaded blue). We do not want any row to show up selected till it is clicked by the user. We tried setting the selected row index to -1. It works but the grid throws an internal exception. Can you please suggest a resolution ? Thanks, Supriya

1 Reply

AD Administrator Syncfusion Team July 9, 2004 02:35 PM UTC

I am not sure I understand what you are describing? Do random rows appear selected the very first time the grid is drawn? I would not know what would cause this without seeing a sample. The default behavior of a griddataboundgrid is to not show selections when the grid loses focus. You can see this in our samples. (The GridFilterBar sample shows any selections in teh grid being lost when you click on the text on teh combobox at the top, or on any of the buttons on the form.) Are you handling any events or overrides that might be affecting this normal behavior, like SelectionsChanging or any of the validation events like CurrentCellValidating or RowLeave that might not let the focus leave the grid. Something to try might be to handle the grid.Leave event and in the handler, call grid.Selections.Clear (though this is normally not needed). If you can tell us how to see the problem in one of our samples, or post a sample showing the problem, we might be able to suggest something else.

Live Chat Icon For mobile
Up arrow icon