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
Unfortunately, activation email could not send to your email. Please try again.
Syncfusion Feedback

ComboBoxExt + GridListControl + Bind

Thread ID:





4716 May 28,2003 07:17 AM UTC Oct 15,2003 09:57 AM UTC WinForms 12
Tags: GridControl
Administrator [Syncfusion]
Asked On May 28, 2003 07:17 AM UTC

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

Administrator [Syncfusion]
Replied On 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.

Administrator [Syncfusion]
Replied On 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

Administrator [Syncfusion]
Replied On 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

Administrator [Syncfusion]
Replied On 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.

Administrator [Syncfusion]
Replied On 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

Administrator [Syncfusion]
Replied On 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.

Administrator [Syncfusion]
Replied On 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

Tim Lloyd
Replied On 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.

Administrator [Syncfusion]
Replied On 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.

Tim Lloyd
Replied On October 15, 2003 08:44 AM UTC

Clay, I was looking for the behaviour which I get using a gridlistcontrol as a dropdown in a grid. I would like this behaviour in a stand-alone combobox type control. Any plans to support this feature? Tim.

Administrator [Syncfusion]
Replied On 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.

Tim Lloyd
Replied On October 15, 2003 09:57 AM UTC

Many thanks for the update.


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