MultiColumn Combo - Format Text

3 posts, 0 answers
  1. AdrianG
    AdrianG avatar
    17 posts
    Member since:
    Jun 2013

    Posted 10 Feb 2015 Link to this post


    Could you advise how to set the format for the text display element of a MultiColumn combo box?

    The data member part of the drop-down is associated with a DateTime column for which I have set the FormatString property to {0:dd.MM.yyyy HH:mm} via the designer.

    So, the drop down shows dates in my required format (e.g. 10.02.2015 12:00) but the text still displays as 10/02/2015 12:00:00.

    Any help with customizing the format would be greatly appreciated.


  2. Ralitsa
    Ralitsa avatar
    192 posts

    Posted 11 Feb 2015 Link to this post

    Hi Adrian,

    Thank you for contacting us. 

    You can subscribe to the TextChanged event of the TextBoxItem to set the desired format of the date. Please refer to the following code snippet: 

     - subscribe to the event: 
    this.radMultiColumnComboBox1.TextChanged += radMultiColumnComboBox1_TextChanged;

    - format the text in the event handler:
    bool isFormatting;
    void radMultiColumnComboBox1_TextChanged(object sender, EventArgs e)
        if (isFormatting)
        isFormatting = true;
        if (this.radMultiColumnComboBox1.SelectedIndex != -1)
            object value = this.radMultiColumnComboBox1.EditorControl.Rows[this.radMultiColumnComboBox1.SelectedIndex].Cells["Time"].Value;
            if (value != null)
                DateTime time = (DateTime)value;
                string text = time.ToString("dd.MM.yyyy HH:mm");              
                this.radMultiColumnComboBox1.MultiColumnComboBoxElement.TextBoxElement.TextBoxItem.Text = text;
        isFormatting = false;

    In attachments you can find a sample demo.  

    Hope this will help you. Let me know if you have any another questions.


    Check out the Telerik Platform - the only platform that combines a rich set of UI tools with powerful cloud services to develop web, hybrid and native mobile apps.

  3. AdrianG
    AdrianG avatar
    17 posts
    Member since:
    Jun 2013

    Posted 11 Feb 2015 in reply to Ralitsa Link to this post

    Hi Ralitsa

    Just to confirm that works. Thanks very much.


Back to Top