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

GridDataBoundGrid - How to get value of ComboBox in different column

Thread ID:





49918 Sep 29,2006 12:48 PM UTC Oct 3,2006 05:01 AM UTC WinForms 1
Tags: GridControl
Clive Hill
Asked On September 29, 2006 12:48 PM UTC


When editing a cell in a GridDataBoundGrid, i need to get the value of the selected item in a ComboBox of a cell in a different column but same row. To do this I assume I need to get a reference to GridComboBoxCellRenderer.

I can''t see how to get this reference. I can get the GridStyleInfo like:

GridStyleInfo style = dataGrid[cc.RowIndex,cc.ColIndex-1];

but the GridComboBoxCellRenderer?

Administrator [Syncfusion]
Replied On October 3, 2006 05:01 AM UTC

Hi Vito,

You can use the GetCellRenderer method to get the reference to the GridComboBoxCellRenderer in a grid and use the ListBoxPart.SelectedItem property to get the selected item of the combo box cell. Below is a code snippet

GridCurrentCell cc = this.gridDataBoundGrid1.CurrentCell;
GridStyleInfo style = this.gridDataBoundGrid1.Model[cc.RowIndex,5];
GridComboBoxCellRenderer cr = this.gridDataBoundGrid1.GetCellRenderer( cc.RowIndex,5) as GridComboBoxCellRenderer;

if( cr != null)
DataRowView row = cr.ListBoxPart.SelectedItem as DataRowView;
Console.WriteLine( ":::"+ row[0] + ">>>" + style.CellValue );



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