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 : Nov 16th 2018).
Unfortunately, activation email could not send to your email. Please try again.
Syncfusion Feedback

how can i put in column (datagrid) combo box

Thread ID:

Created:

Updated:

Platform:

Replies:

758 Aug 13,2002 09:41 AM UTC Apr 15,2007 05:11 PM UTC WinForms 12
loading
Tags: FAQ
ramez
Asked On August 13, 2002 09:41 AM UTC

I am using VB.Net I want to put in one of the columns a combo box that related to a differnt table i am using MS SQLServer

Clay Burch [Syncfusion]
Replied On August 13, 2002 12:37 PM UTC

Take a look at the Data bound combobox sample at the bottom of this FAQ. http://www.syncfusion.com/faq/winforms/search/480.asp

ramez
Replied On August 14, 2002 07:04 PM UTC

but this one didn't work with i am using VB.NET if you have a sample code and it's already working give to me

Clay Burch [Syncfusion]
Replied On August 14, 2002 10:02 PM UTC

So, you cannot get the VB.NET samples in the FAQ to work? What errors do you get? I think the only thing you would need to change is the connection string.

ramez
Replied On August 16, 2002 07:24 AM UTC

it's not a connection . there in no DataGridComboBoxColumn in VB.Net

Clay Burch [Syncfusion]
Replied On August 16, 2002 07:35 AM UTC

The DataGridComboBoxColumn class is defined in that sample. You would have to copy that code that defines the class DataGridComboBoxColumn from the sample to your project in order to use it.

ramez
Replied On August 18, 2002 10:28 AM UTC

It works now thanks for your kind help

ramez
Replied On August 18, 2002 03:22 PM UTC

i didn't add item in combobox but i use datasource from another table i display something and the value is another thing(not the same type) it's not work who can i solve this problem?????

Clay Burch [Syncfusion]
Replied On August 18, 2002 08:42 PM UTC

The last sample in the same FAQ shows how you can use another datasource for the combobox.

ramez
Replied On August 19, 2002 07:30 AM UTC

is this what you mean : ((FAQ:How do I use the DataColumn.Expression property to add a computed/combined column to my datagrid?)) this is not what i mean. i have a combobox in datagrid and this combobox has a datasource different(not like the datagrid another table)(ex.it display list of sex(male,female) and return (0,1)value into the datagrid) it display a list of item(by query) from table and the vaule is another attribute. when i used it in the datagrid it not work because it take the display item not the value for this item(ofcourse they are not the same type)

Clay Burch [Syncfusion]
Replied On August 19, 2002 08:53 PM UTC

I mean the FAQ about putting comboboxes in a datagrid. http://www.syncfusion.com/faq/winforms/search/480.asp At the bottom of this FAQ, you will find: Databound ComboBox Sample
To use a databound combobox, you have to add overrides for SetColumnValueAtRow and GetColumnValueAtRow to switch the DisplayMember and ValueMember as you get and set the data from the underlying table. Also, you cannot have the ComboBox bound with the same BindingContext to the same datasource as the datagrid. You can download a working project (C#, VB) that implements a databound combobox in a datagrid.

Administrator [Syncfusion]
Replied On February 21, 2007 09:34 AM UTC



>I mean the FAQ about putting comboboxes in a datagrid.
>
>http://www.syncfusion.com/faq/winforms/search/480.asp
>
>At the bottom of this FAQ, you will find:
>
>Databound ComboBox Sample

>To use a databound combobox, you have to add overrides for SetColumnValueAtRow and GetColumnValueAtRow to switch the DisplayMember and ValueMember as you get and set the data from the underlying table. Also, you cannot have the ComboBox bound with the same BindingContext to the same datasource as the datagrid. You can download a working project (C#, VB) that implements a databound combobox in a datagrid.
>

Rommel
Replied On April 15, 2007 05:11 PM UTC

I have an issue using this combo box everytime im adding new record and select the item from the combo box it selects the top selected index automatically but once you move to another record it will show the correct selected item. How do I resolve this issue. I tried to run the sample VB.net code and its acts the same thing..

CONFIRMATION

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.

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

;