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
close icon

loading combo in grid

I am using vb.net and syncfusion grid(Syncfusion.Windows.Forms.Grid.GridControl) I have a colunm in the grid which is a combobox. I want to load the combo as normal .net combo with DisplayMember and ViewMember Currentlly i am using ChoiceList property,this can hold only one value my aim is to show customer name in the list and carry customerID at backend

1 Reply

AD Administrator Syncfusion Team June 11, 2004 07:40 PM UTC

One way to do this is to create a DataTable, yourDateTable, holding two columns, your DisplayMember property and your ValueMember property. Then in the cell where you want to see the combobox, you set the style properties like: Dim style as GridStyleInfo = me.GridControl1(2,2) style.DataSource = yourDataTable style.CellType = "ComboBox" style.DisplayMember = "displayMemberColumnName" style.ValueMember = "valueMemberColumnName" Here is a sample using a GridDataBoundGrid, but it should illustrate how you can set up your DataTable. Another option, instead of a DataTable, is to use an ArrayList of objects where the objects instantiate a class that you define having two public properties that are you displaymember and valuemembers. In this case you would set style.DataSource = the ArrayList. WindowsApplication11_199.zip

Live Chat Icon For mobile
Up arrow icon