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.

MultiColumnComboBox

Thread ID:

Created:

Updated:

Platform:

Replies:

33664 Aug 23,2005 07:15 PM Aug 26,2005 12:17 PM Windows Forms 6
loading
Tags: Tools
Ivan
Asked On August 23, 2005 07:15 PM

Hi, Is there a way to set formatting of the Text property of the MultiColumnComboBox? Please consider the following: The DataSource of the MultiColumnComboBox is a DataTable with the structure: Column1- DateTime Column2 –DateTime MultiColumnComboBox.DisplayMember=”Column1”; MultiColumnComboBox.ValueMember=”Column2”; So displayed text would be in the format “mm/dd/yyyy hh:mm:ss AM/PM”, but I want it to be displayed with the “{0:d}” format. Thank you

Anupama Roy [Syncfusion]
Replied On August 24, 2005 10:57 AM

Hi Ivan The MultiColumnComboBox uses the GridListControl internally as its dropdown and we do not have a property to set any custom format for the Text displayed in a MultiColumnComboBox. Regards, Anu

Ivan
Replied On August 24, 2005 11:03 AM

What would be a workaround then? Thank you

Administrator [Syncfusion]
Replied On August 25, 2005 09:17 AM

Hi Ivan The display text in the grid can be formatted using QueryCellInfo event of the GridListControl Here is a sample

Ivan
Replied On August 25, 2005 12:25 PM

Thank you for the example, but it does not solve my problem. Although the grid cells are formatted, the text of the MultiColumnComboBox is not. I don''t have a source code for the control, but I suspect that the text property is set by converting the cell value to string (ToString()). Is there an event I can intercept, when the cell value is read, so I can pass the properly formatted string? Thank you

Administrator [Syncfusion]
Replied On August 26, 2005 06:40 AM

Hi Ivan, To format the text in the MultiColumnComboBox, you need not rely on grid formatting. Handling of the SelectedIndexChanged event would solve your problem. this.multiColumnComboBox1.SelectedIndexChanged += new EventHandler(multiColumnComboBox1_SelectedIndexChanged); private void multiColumnComboBox1_SelectedIndexChanged(object sender, EventArgs e) { DateTime date = System.DateTime.Parse(this.multiColumnComboBox1.Text); this.multiColumnComboBox1.Text = date.ToString("{0:d}"); } Best regards, Stanley

Ivan
Replied On August 26, 2005 12:17 PM

Thank you. I greatly appreciate your time.

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.

;