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
close icon

GDBG / DropDownFormCell Display

I have created a DropDownFormCell control and defined a column in a GDBG to be this control. The DataSource is set to a DataView of a table that has an Id and a Description column. The DisplayMember is set to Description and the ValueMember is set to Id. When the user makes a selection in the DropDownForm, the grids CellValue member is set to the selected Id. After the form is gone, the numeric Id is displayed in the cell instead of the description. Any thoughts on what I may have missed to display the description?


1 Reply

HA haneefm Syncfusion Team January 9, 2008 11:04 PM UTC

Hi Ken,

You can try setting the gridcell in the OnButtonClicked method of DropDownFormCellRenderer class. Below are the codes:

public class DropDownFormCellRenderer: GridStaticCellRenderer
{

protected override void OnButtonClicked(int rowIndex, int colIndex, int button)
{
this.Grid.CurrentCell.MoveTo(rowIndex, colIndex);
//Console.WriteLine("clicked ({0},{1})", rowIndex, colIndex);

this.ddForm.SetValuesFromString(this.Grid.Model[rowIndex, colIndex].Text);
Rectangle rect = this.Grid.RangeInfoToRectangle(GridRangeInfo.Cell(rowIndex, colIndex));

this.ddForm.Location = this.Grid.PointToScreen(new Point(rect.Left, rect.Bottom));

if(this.ddForm.ShowDialog() == DialogResult.OK)
{
this.Grid.Model[rowIndex, colIndex].Text = "Your DescriptionText Here";
}
//base.OnButtonClicked (rowIndex, colIndex, button);
}
}


Best regards,
Haneef


Loader.
Live Chat Icon For mobile
Up arrow icon