Hi all,
My application displays read-only data in a WinForms DataGrid. When the
user selects a row in the grid then I want the entire row to simply be
highlighted. However, the grid insists on displaying the selected cell as
though it was editable (entire cell has a grey background, selected
characters are white on a navy background).
As described in the technical article "Customizing the Windows Forms
DataGrid", I created my own derived DataGridTextBoxColumn class and overrode
the Draw method. Even though I paint the cells in that method, the datagrid
subsequently paints its own stuff on the current cell.
TIA
- Bob
Bob Altman - 29 Mar 2006 19:31 GMT
Turns out that if you override the Edit method then the grid doesn't display
the the editing cues:
' Override the Edit method to suppress the editing cues
Protected Overloads Overrides Sub Edit(...)
' <Do nothing>
End Sub
> Hi all,
>
[quoted text clipped - 7 lines]
> DataGrid", I created my own derived DataGridTextBoxColumn class and overrode
> the Paint method. Even though I paint the cells in that method, the
datagrid
> subsequently paints its own stuff on the current cell.
>
> TIA
>
> - Bob