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. (Last updated on : Nov 16th 2018).
Unfortunately, activation email could not send to your email. Please try again.
Syncfusion Feedback

MultiColumnComboBox

Thread ID:

Created:

Updated:

Platform:

Replies:

33664 Aug 23,2005 11:15 PM UTC Aug 26,2005 04:17 PM UTC WinForms 6
loading
Tags: Tools
Ivan
Asked On August 23, 2005 11:15 PM UTC

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 02:57 PM UTC

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 03:03 PM UTC

What would be a workaround then? Thank you

Administrator [Syncfusion]
Replied On August 25, 2005 01:17 PM UTC

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 04:25 PM UTC

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 10:40 AM UTC

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 04:17 PM UTC

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.

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

;