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

combo value list

Hi, I have a GridHierDataBoundGrid that contains a databound grid. I need one column of the GridHierDataBoundGrid to be a combobox that gets it''s values from a list that I specify. Can someone provide a code sample of this? Thanks, CB

4 Replies

AD Administrator Syncfusion Team January 29, 2004 03:46 PM

The GDBGwithDropGrids sample has code like this to add dropdown lists from other DataTables. GridStyleInfo style = ((GridDataBoundGrid)e.Grid).GridBoundColumns["EmployeeID"].StyleInfo; style.CellType = "ComboBox"; style.DataSource = this.dataSet11.Employees; style.ValueMember = "EmployeeID"; style.DisplayMember = "LastName"; style.ExclusiveChoiceList = true; If you want to create a list yourself, you can change this code like: style.CellType = "ComboBox"; StringCollection sc = new StringCollection(); sc.Add("11"); sc.Add("22"); sc.Add("33"); style.DataSource = sc;


AD Administrator Syncfusion Team January 29, 2004 04:16 PM

Thanks again, one more question though: I need the value displayed to be based on the value of another column in the same grid, but as I mentioned before I will use a choice list for the drop down portion. Is there a way to specify this? I hope that makes sense >The GDBGwithDropGrids sample has code like this to add dropdown lists from other DataTables. > >GridStyleInfo style = ((GridDataBoundGrid)e.Grid).GridBoundColumns["EmployeeID"].StyleInfo; >style.CellType = "ComboBox"; >style.DataSource = this.dataSet11.Employees; >style.ValueMember = "EmployeeID"; >style.DisplayMember = "LastName"; >style.ExclusiveChoiceList = true; > > >If you want to create a list yourself, you can change this code like: > >style.CellType = "ComboBox"; >StringCollection sc = new StringCollection(); >sc.Add("11"); >sc.Add("22"); >sc.Add("33"); >style.DataSource = sc; >


AD Administrator Syncfusion Team January 29, 2004 04:54 PM

Here are a couple of KB articles that discuss how you can do this. http://www.syncfusion.com/Support/article.aspx?id=567 http://www.syncfusion.com/Support/article.aspx?id=10420


AD Administrator Syncfusion Team January 29, 2004 07:01 PM

Thanks again! >Here are a couple of KB articles that discuss how you can do this. > >http://www.syncfusion.com/Support/article.aspx?id=567 > >http://www.syncfusion.com/Support/article.aspx?id=10420

Loader.
Live Chat Icon For mobile
Up arrow icon