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

Combobox in datagrid.

Thread ID:





60056 Apr 26,2007 06:17 PM UTC Apr 26,2007 07:46 PM UTC WinForms 1
Tags: GridControl
Asked On April 26, 2007 06:17 PM UTC

I am trying to use a combobox to display one value but save another using the example in the documentation...

Private Sub Form1_Load(sender As Object, e As System.EventArgs)
Me.gridDataBoundGrid1.DataSource = PrimaryTable
Me.gridDataBoundGrid1.EnableAddNew = False

Dim gbc As GridBoundColumn = Me.gridDataBoundGrid1.Binder.InternalColumns(1)
gbc.StyleInfo.CellType = "ComboBox"
gbc.StyleInfo.DataSource = ForeignKeyTable
gbc.StyleInfo.DisplayMember = "Name"
gbc.StyleInfo.ValueMember = "CustID"
gbc.StyleInfo.ShowButtons = GridShowButtons.ShowCurrentRow
gbc.StyleInfo.HorizontalAlignment = GridHorizontalAlignment.Left
End Sub

The combobox works as long as there is a match in against the display member. A problem occurs when the enters text that doesn't match. The column attempts to add the text anyway which causes a problem with the underlying datasource. Unfortunately, the control has it's own error handler so I am unable to deal with the situation. Any suggestions would be most helpful

haneefm [Syncfusion]
Replied On April 26, 2007 07:46 PM UTC

Hi Marc,

Please refer to the KB article on validating the cells in a grid.

Let me know if this helps.

Best Regards,


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

or the page will be automatically redirected to 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