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

filtered combobox lists in gdbg

Thread ID:





24944 Feb 15,2005 08:45 AM UTC Feb 17,2005 02:15 PM UTC WinForms 7
Tags: GridControl
Maqsood Ahmed
Asked On February 15, 2005 08:45 AM UTC

Hello, Please have a look at the following scenario and guide me through that how can implement this functionality. Scenario: --------- - A dataset with users information - A GridDataBoundGrid on WinForm previously I used to have one vehicle number against each UserID and I used to display it in an static cell. Now requirements have been changed and I have to show multiple Vehicle numbers in a combobox and user may select 1 vehicle number from the list. How can I implement this scenario, please note that each UserID has its own list of vehicle numbers. Also tell me a better way to store such data. Another datatable with relations?? Thanks in advance Maqsood Ahmed Kolachi Advanced Technologies http://www.kolachi.net

Administrator [Syncfusion]
Replied On February 15, 2005 11:16 AM UTC

Take a look at this KB. It describes how you can use teh value in one combobox cell to determine the dropdownlist for a second combobox cell. In your case, it looks like the first cell is not a combobox, but I think you can use a same idea to determine the dropdown for the second cell from the non-combobox first cell. http://www.syncfusion.com/Support/article.aspx?id=567

Maqsood Ahmed
Replied On February 16, 2005 01:51 PM UTC

Hello, Thanks for the help. It had solved the problem quite fairly. Now, I am running into another problem. I want to reflect changes in the dropdown to the datatable. It have tried gridDataBoundGrid.CommitChanges(), it doesn''t reflect it to the original datatable (the one with UserID and Primary vehicle no.) as well as it doesn''t updates the grid cell. For Example: I had 2 vehicle nos. in the DropDown V-1234 and V-9696 with Primary vehicle set to V-9696. I changed it to V-1234, but when I checked it in the DataTable it was V-9696 in the datarow. And it was showing V-9696 in the grid. Any help in this regard? Thanks Maqsood Ahmed Kolachi Advanced Technologies http://www.kolachi.net

Administrator [Syncfusion]
Replied On February 16, 2005 03:56 PM UTC

Try calling grid.Binder.EndEdit to see if this does what you need.

Maqsood Ahmed
Replied On February 17, 2005 05:53 AM UTC

Hello, I have tried calling EndEdit and it didn''t work. I have also tried to attach a sample of my code but I failed to do it. Is there anyway through which I can send it to you? Maqsood Ahmed Kolachi Advanced Technologies http://www.kolachi.net

Maqsood Ahmed
Replied On February 17, 2005 06:53 AM UTC

Please have a look at the following Sample. SampleComboBox_2979.zip

Administrator [Syncfusion]
Replied On February 17, 2005 09:24 AM UTC

A couple of things. You have gridDataBoundGrid1.EnableEdit set to false. This is what is preventing the change to the grid value. The other thing is that you need to set these properties on the combobox column: this.gridBoundColumn5.StyleInfo.DisplayMember = "VEHICLE"; this.gridBoundColumn5.StyleInfo.ValueMember = "VEHICLE"; this.gridBoundColumn5.StyleInfo.DataSource = dtVehicleInfo; so the grid can match things up when the combobox is not dropped. Now I am not sure I understand the other part of the problem that you mentioned. Do you want something in dtVehicleInfo to change as a result of using the combobox in the grid? Or do you want the change to show immediately in the User table? Changing dtVehicleInfo is not how foreign tables normally operate as they generally are readonly. Here is your sample back with the changes showing up immediately in the user table. There is a Windows Forms DataGrid dropped on the form so you can see that the user table is changed when the dropdown closes. The default behavior would be to make the change when the user leaves the row. SampleComboBox.zip

Administrator [Syncfusion]
Replied On February 17, 2005 02:15 PM UTC

Hello, Thanks. It worked fine. Maqsood Ahmed Kolachi Advanced Technologies http://www.kolachi.net


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