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

Combobox in datagrid.

Thread ID:

Created:

Updated:

Platform:

Replies:

60056 Apr 26,2007 06:17 PM UTC Apr 26,2007 07:46 PM UTC Windows Forms 1
loading
Tags: GridControl
marc
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.
http://www.syncfusion.com/support/kb/grid/Default.aspx?ToDo=view&questId=340


Let me know if this helps.

Best Regards,
Haneef

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

;