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

ComboBoxExt + GridListControl + Bind

Hello I have some difficulties to bind a gridlistcontrol to a dataset.... : i have a comboboxExt combine with a GridListControl. The GLC has a datasource, displaymember and value member correct. The selectedValue is bond with value in the dataset my problem is that the combo does not show the correct value (it shows the first element of the GLC) and when I select a new value, the databind is not update conclusion : The bind doesn't work.... WHY????? Where is the mistake? Thanks a lot... lobrys

12 Replies

AD Administrator Syncfusion Team May 28, 2003 07:52 AM UTC

Make sure the comboboxext and gridlistcontrol are both using the same BindingContext. If they are using different contexts, the positions will not sync up. Maybe try code like, this.comboBoxExt1.BindingContext = this.BindingContext; this.gridListControl1.BindingContext = this.BindingContext; This will set both contexts equal to your form's BindingContext.


AD Administrator Syncfusion Team May 28, 2003 10:35 AM UTC

Thanks for your answer... I dont understand...I doesn't work... Here is my code: Me.GridListControl1.DataBindings.Add("SelectedValue", ds, "table1.id") ComboBoxExt1.ListControl = GridListControl1 GridListControl1.DataSource = GET_TABLE("SOMETHING") GridListControl1.DisplayMember = "lib" GridListControl1.ValueMember = "id" ComboBoxExt1.BindingContext = Me.BindingContext GridListControl1.BindingContext = Me.BindingContext Me.BindingContext(ds, "table1").Current is at the good value first...and never change... help me pleazzz... lobrys


AD Administrator Syncfusion Team May 28, 2003 10:51 AM UTC

Can you try and if it works with a regular Windows Forms Listbox? Or is it just the GridListControl where it does not work? Stefan


AD Administrator Syncfusion Team May 29, 2003 09:05 AM UTC

Try commenting out your code: Me.GridListControl1.DataBindings.Add("SelectedValue", ds, "table1.id") When you set the DataSource and ValueMember, this automatically binds the SelectedValue. If that does not work, if you can attach a sample shwoingthe problem we can look into it. Or, you can submit a Direct Trac support incident with a project.


AD Administrator Syncfusion Team June 2, 2003 08:00 AM UTC

Hello again.... first, thanks All for everything... secondly, I can't make my project work here is a sample project with my problem the aim is to print in a comboboxExt the name of the father of a person X the person X is located in a Dataset, table="tab_ds", row=0 the comboBoxExt works with a GridListControl which contains the list of All the persons... I must be able to change the father of the person X by changing in the gridlistcontrol I wish it is understandable.... (excuse me for my poor english) Thanks all.... Lobrys


AD Administrator Syncfusion Team June 2, 2003 09:53 AM UTC

I think you can get this to work by removing Me.GridListControl1.DataBindings.Add("SelectedValue", ds, "tab_ds.father") and instead listen to the ComboBoxExt1_SelectionChangeCommitted event and explicitly set the value there. Here is your sample back with the changes. I also added a couple of dataGrids just to see the raw datatables as you change the combobox.


AD Administrator Syncfusion Team June 2, 2003 11:50 AM UTC

Thanks a lot Clay! It's working perfectly.... now, i am converting this in a usercontrol, and everything will be OK.... Thanks again! Lobrys


TL Tim Lloyd October 15, 2003 07:33 AM UTC

Is it possible to enable strict autocompletion behaviour with a gridlistcontrol/comboboxext combination so that only values that are in the gridlistcontrol can be entered into the combobox. With this example it is possible to enter a value that is not consistant with the list. Many Thanks, Tim.


AD Administrator Syncfusion Team October 15, 2003 08:36 AM UTC

For a GridListControl celltype in a grid cell, if you set the GridStyleInfo.DropDownStyle to AutoComplete, then you get autocomplete and you can only type entries from the droplist. For a ComboBoxExt, this behavior is not supported. But if you set the ComboBoxExt1.DropDownStyle = ComboBoxStyle.DropDownList, then you are restricted to values in the list, but typing only matches the first character which is the standard ComboBoxStyle.DropDownList behavior.



AD Administrator Syncfusion Team October 15, 2003 09:43 AM UTC

We do have this as a feature request, but it has not made the upcoming 2.0 release. So, it will be at least the 2.1 time frame before it could be added.


TL Tim Lloyd October 15, 2003 09:57 AM UTC

Many thanks for the update.

Loader.
Up arrow icon