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

problem with combobox in cell

Thread ID:

Created:

Updated:

Platform:

Replies:

24601 Feb 8,2005 05:02 AM Feb 8,2005 09:00 AM Windows Forms 2
loading
Tags: GridControl
Muthu Swamy
Asked On February 8, 2005 05:02 AM

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 05:37 AM

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 09:00 AM

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

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

;