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

Another GridDataBoundGrid ComboBox question

I'm using a very simple MS Access data base which I'm binding to a GridDataBoundGrid via OldDataAdapter. Everything works as expected except for one of the Access fields which I've defined as follows: Data Type = Text Display Control = ComboBox Row Source Type = Value List Row Source = Choice1;Choice2;Choice3 While in Access, this field behaves as expected- a ComboBox with 3 choices in the item list. However in GridDataBoundGrid, the field shows up as a ComboBox with only a single choice in the list. I'm using GridBoundColumns & have tried changing all parameters for this field without success. Any suggestions?

3 Replies

AD Administrator Syncfusion Team January 28, 2003 04:13 PM UTC

Try creating a StringCollection object that has your three entries. Then set the StringCollection object to be the StyleInfo.ChoiceList property of the GridBoundColumn. StringCollection sc = new StringCollection(); sc.AddRange(new string[]{"Choice1", "Choice2", "Choice3"}); //... //... gridBoundColumn1.StyleInfo.ChoiceList = sc;

BK Bill Korchinski January 28, 2003 04:53 PM UTC

Thanks. Dumb question- what's the VB syntax for sc.AddRange(new string[]{"Choice1", "Choice2", "Choice3"}) ?

AD Administrator Syncfusion Team January 29, 2003 06:19 AM UTC

VB is not square, its round :) Dim sc As New System.Collections.Specialized.StringCollection() sc.AddRange(New String() {"Choice1", "Choice2", "Choice3"}) gridBoundColumn1.StyleInfo.ChoiceList = sc

Live Chat Icon For mobile
Up arrow icon