collection of columnnames


Hi,

Is there a way to get a collection of all of the columnnames in a databoundgrid whether they are shown or not?

I tried using these two functions, but they seem to only contain the columns that are currently shown in the databoundgrid. Thanks!

gridDataboundGrid.Binder.GridBoundColumns[i].MappingName;
gridDataboundGrid.Binder.InternalColumns[i].MappingName;

1 Reply

HA haneefm Syncfusion Team June 29, 2007 02:42 PM UTC

Hi Code12345,

Is there a way to get a collection of all of the columnnames in a databoundgrid whether they are shown or not?
>>>>>>>>
You can try these code:

CurrencyManager cm = (CurrencyManager) this.BindingContext[this.gridDataBoundGrid1.DataSource, this.gridDataBoundGrid1.DataMember];

PropertyDescriptorCollection pdc = cm.GetItemProperties();
foreach (PropertyDescriptor pd in pdc)

{
Console.Writeline( pd.Name);
}

Best regards,
Haneef

Loader.
Up arrow icon