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

problem with combobox in cell

Thread ID:





24601 Feb 8,2005 10:02 AM UTC Feb 8,2005 02:00 PM UTC WinForms 2
Tags: GridControl
Muthu Swamy
Asked On February 8, 2005 10:02 AM UTC

Hi, I have placed ComboBox in my GridDataBoundGrid object called myGrid. I had binded combobox column using a DataTable object using GridCurrentCellShowingDropDownEventArgs EVENT as shown here. I got the list and working fine. My issue arises while getting the selected value from the ComboBox cell. I used myGrid_CurrentCellCloseDropDown as shown here. I''m getting null value for cb.ControlText.controlValue. Kindly let me WHERE I''m WRONG?? MS ------------------------------------ private void myGrid_CurrentCellShowingDropDown(object sender, Syncfusion.Windows.Forms.Grid.GridCurrentCellShowingDropDownEventArgs e) { GridControlBase grid = sender as GridControlBase; if(grid != null) { GridCurrentCell cc = grid.CurrentCell; GridComboBoxCellRenderer cr = cc.Renderer as GridComboBoxCellRenderer; if(cc != null) { GridComboBoxListBoxPart listBoxPart = (GridComboBoxListBoxPart)cr.ListBoxPart; listBoxPart.DataSource = dttblQualification; listBoxPart.DisplayMember = "Qualification"; } } } ------------------------------------------------- private void myGrid_CurrentCellCloseDropDown(object sender, Syncfusion.Windows.Forms.PopupClosedEventArgs e) { GridControlBase grid = (GridControlBase)sender; GridComboBoxCellRenderer cb = (GridComboBoxCellRenderer) grid.CurrentCell.Renderer; string controlText=""; object controlValue = new object(); if(cb != null) { controlText = cb.ControlText; controlValue = cb.ListBoxPart.Text; } myGrid.Model[myGrid.CurrentCell.RowIndex, myGrid.CurrentCell.ColIndex].Text = controlText; myGrid[myGrid.CurrentCell.RowIndex, myGrid.CurrentCell.ColIndex].CellValue = controlValue; }

Administrator [Syncfusion]
Replied On February 8, 2005 10:37 AM UTC

A couple of comments. Setting style.CellValue and style.Text in closedropdown is setting a single value. These two properties in GridStyleInfo are linked to each other and setting one sets both. Also, the grid normally handles setting the values back into itself. Why do you need the code setting values into the grid in closedropdown? What are you trying to accomplish? As far as the null value, try also setting listBoxPart.ValueMember = "Qualification"; to see if that makes things work better.

Muthu Swamy
Replied On February 8, 2005 02:00 PM UTC

Clay Burch, Thanks and this works perfect. --------- listBoxPart.ValueMember = "Qualification"; --------- MS


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