James Lennon wrote:
I have a WindowsForms.DataGrid that I am using to display
a datatable. The datagrid is composed of
TextBoxColumns. I would like to make the DataGrid have
the following behavior. When a user selects a row in the
datagrid that row is highlighted and selected regardless
of the column. I have accomplished this by overriding
the datagrids mouse down event and selecting the row.
However under some circumstances the text box control
gains focus and the row is no longer highlighted. How
can I stop the text box in a text box column from gaining
focus? I have tried seting focus to the control in the
mouse down handler but that did not work.
If your grid is REALLY read-only, on the first mouse down, remove all
controls from the datagrid controls collection with the exception of the
horizontal and vertical scroll bars...
/steveA