Datagrid readonly column problem

  • Thread starter Thread starter Paulo Gon?alves via .NET 247
  • Start date Start date
P

Paulo Gon?alves via .NET 247

My datagrid has a big problem, it happens only in columns that are read only.
Please see the picture at
http://mega.ist.utl.pt/~pfrg/datagrid/datagrid_problem.jpg
The gost that I show it?s like a new readonly textbox.
If the selected cell it?s not readonly there?s no problem.
I think that the problem it?s ralated with lose of focus of the datagrid.
After pressing a button, I fill again the datagrid with new datasource but this thing remains, hiding the new value!
Only with scrool I can see that the new value it?s really there but the old is hiding it.
I tried datagrid Refresh() and so many things but nothing works.
Need help please.

Thanks,
 
Hi Paulo,

You can try the following. Create a DataGrid column style derived from
DataGridTextBoxColumn.
In the derived style, override the Edit method and do nothing in the
overridden implementation.
Use the new grid column style for the problematic column.

Also, make sure you use the grid's SetDataBinding method to bind the grid to
the new datasource.
 
Back
Top