We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy. Image for the cookie policy date

Iterating through columns in a GGC and checking if a column has a dropdown list

Hi, Assuming i have 4 columns and one of them has a dropdownlist. Is there a way to iterate through the columns in the GridGroupingControl until i come across the column that has the dropdown list. Also, how do i check if a column has a dropdown list? Regards David

5 Replies

AD Administrator Syncfusion Team July 4, 2005 01:18 PM UTC

Where do you want to do this? You can always iterate through the grid.TableDescriptor.VisibleColumns.
foreach(GridVisibleColumnDescriptor cd in this.gridGroupingControl1.TableDescriptor.VisibleColumns)
{
	// cd.Name has column name
        //this.gridGroupingControl1.TableDescriptor.Columns[cd.Name].FieldDescriptor has the filed
}
But if you are in some event, there may be a simpler way to get at this information through the event args.


TH Thabo July 4, 2005 01:23 PM UTC

>Where do you want to do this? > >You can always iterate through the grid.TableDescriptor.VisibleColumns. >
>foreach(GridVisibleColumnDescriptor cd in this.gridGroupingControl1.TableDescriptor.VisibleColumns)
>{
>	// cd.Name has column name
>        //this.gridGroupingControl1.TableDescriptor.Columns[cd.Name].FieldDescriptor has the filed
>}
>
> >But if you are in some event, there may be a simpler way to get at this information through the event args. I would actually like to di it in an event that''s caught when a row is deleted from a GridDataBoundGrid. By the way, can you also tell me which event handler is suitable when deleting a row. I''m not sure if the RowsDeleted is the correct one to use


AD Administrator Syncfusion Team July 4, 2005 01:27 PM UTC

I am confused. The first question asks about a GridGroupingControl and this one mentions a GridDataBoundGrid. Exactly how you do this depened upon what grid you are using.


TH Thabo July 5, 2005 06:08 AM UTC

>I am confused. The first question asks about a GridGroupingControl and this one mentions a GridDataBoundGrid. Exactly how you do this depened upon what grid you are using. Sorry, my mistake, i''m actually using a GroupDataBoundGrid. Another thing is that, while iterating through the columns, i''d like to break when i come across a column that has a dropdown list. So what i really want is code sample that iterates through the columns of a GroupDataBoundGrid and at the same time checks if the cells of a column have a dropdown list. Regards David


AD Administrator Syncfusion Team July 5, 2005 08:46 AM UTC

foreach(GridBoundColumn col in this.grid.GridBoundColumns)
{
   if(col.StyleInfo.CellType == "ComboBox")
   {
       Console.WriteLine("This is a combobox");
   }
}

Loader.
Live Chat Icon For mobile
Up arrow icon