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. (Last updated on: June 24, 2019).
Unfortunately, activation email could not send to your email. Please try again.
Syncfusion Feedback

Combobox questions

Thread ID:





16062 Jul 5,2004 07:49 PM UTC Jul 5,2004 09:37 PM UTC WinForms 1
Tags: GridControl
Corinne Muir
Asked On July 5, 2004 07:49 PM UTC

Hi, 1) is there a way to use the actual object in a combobox in a grid cell other than setting a text choice list? The .net combobox lets you assign objects to the .items 2) is there a way to sort the combobox choice list? thanks, Corinne

Administrator [Syncfusion]
Replied On July 5, 2004 09:37 PM UTC

You can set the style.DataSource, style.DisplayMember and style.ValueMember to use an ADO.NET datasource to provide values for a combobox list. private void Form1_Load(object sender, System.EventArgs e) { DataTable dt = new DataTable("MyTable"); dt.Columns.Add(new DataColumn("value")); dt.Columns.Add(new DataColumn("display")); DataRow dr = dt.NewRow(); dr[0] ="1"; dr[1] = "one"; dt.Rows.Add(dr); dr = dt.NewRow(); dr[0] ="2"; dr[1] = "two"; dt.Rows.Add(dr); dr = dt.NewRow(); dr[0] ="3"; dr[1] = "three"; dt.Rows.Add(dr); GridStyleInfo style = this.gridControl1[2,2]; style.CellType = "ComboBox"; style.DataSource = dt; style.ValueMember = "value"; style.DisplayMember = "display"; }


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.

Please sign in to access our forum

This page will automatically be redirected to the sign-in page in 10 seconds.

Warning Icon 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.Close Icon

Live Chat Icon For mobile
Live Chat Icon