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.

GDBG / DropDownFormCell Display

Thread ID:

Created:

Updated:

Platform:

Replies:

70910 Jan 8,2008 04:51 PM Jan 9,2008 06:04 PM Windows Forms 1
loading
Tags: GridControl
Kenneth Johnson
Asked On January 8, 2008 04:51 PM

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?


haneefm [Syncfusion]
Replied On January 9, 2008 06:04 PM

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


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.

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.

;