Re: Remove/restore columns in datagrid by Erik
Erik
Wed Oct 29 09:20:55 CST 2003
Hi Clay.
Thanks for the example. I was able to convert it to vb.net but didn't
understand one thing. The DataGridColumnStyle class is marked MustInherit in
vb.net and Abstract in C# so, I could not use dim var as new
DataGridColumnStyle in vb.net. It let me with a doubt. Isn't the framework
that defines if a class is MustInherit or not? Why does C# and vb.net
differs when working with this class?
TIA,
Erik Cruz
"ClayB [Syncfusion]" <clayb@syncfusion.com> wrote in message
news:%23XZC936mDHA.1672@TK2MSFTNGP09.phx.gbl...
> You can do this using a DataGridtbleStyle and its GridColumnStyles member
> without having to actually touch your DataTable. There is one tricky part
> when you add the columns back. You must clear out the old collection, and
> redo the complete set of columnstyles as this object has no insert method.
> Attached is a little sample. It justs adds the columns back into the
middle
> of the grid, but you could use the same technique to put them back into
the
> grid in any position.
>
> ===================
> Clay Burch, .NET MVP
>
> Visit www.syncfusion.com for the coolest tools
>
> "Erik Cruz" <erikacf.spammers.out@antares.com.br> wrote in message
> news:O3fCjV2mDHA.1800@TK2MSFTNGP10.phx.gbl...
> > Hi.
> >
> > I am working on a control derived from the datagrid control. I was able
to
> > remove columns from the datagrid by removing them from the original
> > datatable, but could not find how to restore them. How can I give to my
> > control the capability tp restore removed columns?
> >
> > TIA,
> > Erik Cruz
> >
> >
>
>
>