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.
Unfortunately, activation email could not send to your email. Please try again.

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

Thread ID:

Created:

Updated:

Platform:

Replies:

31239 Jul 4,2005 08:20 AM Jul 5,2005 04:46 AM Windows Forms 5
loading
Tags: GridControl
Thabo
Asked On July 4, 2005 08:20 AM

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

Administrator [Syncfusion]
Replied On July 4, 2005 09:18 AM

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.

Thabo
Replied On July 4, 2005 09:23 AM

>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

Administrator [Syncfusion]
Replied On July 4, 2005 09:27 AM

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.

Thabo
Replied On July 5, 2005 02:08 AM

>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

Administrator [Syncfusion]
Replied On July 5, 2005 04:46 AM

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

CONFIRMATION

This post will be permanently deleted. Are you sure you want to continue?

Sorry, An error occured while processing your request. Please try again later.

You are using an outdated version of Internet Explorer that may not display all features of this and other websites. Upgrade to Internet Explorer 8 or newer for a better experience.

;