Home All Groups Group Topic Archive Search About

Datagrid readonly column problem

Author
5 Apr 2005 12:56 AM
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,





--------------------------------
From: Paulo Gon?alves

-----------------------
Posted by a user from .NET 247 (http://www.dotnet247.com/)

<Id>DiTBOMhdu0KMGTS6J1GZMQ==</Id>

Author
5 Apr 2005 9:22 AM
Dmytro Lapshyn [MVP]
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.

--
Sincerely,
Dmytro Lapshyn [Visual Developer - Visual C# MVP]


Show quoteHide quote
"Paulo Gon?alves via .NET 247" <anonym***@dotnet247.com> wrote in message
news:O0AeBpXOFHA.3716@TK2MSFTNGP14.phx.gbl...
> 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,
>
>
>
>
>
> --------------------------------
> From: Paulo Gon?alves
>
> -----------------------
> Posted by a user from .NET 247 (http://www.dotnet247.com/)
>
> <Id>DiTBOMhdu0KMGTS6J1GZMQ==</Id>

Bookmark and Share