how to display empty msg in radcombobox bind with data

7 posts, 0 answers
  1. Arteta Sam
    Arteta Sam avatar
    31 posts
    Member since:
    Jan 2010

    Posted 26 Mar 2011 Link to this post

    Hi all,

    i have a question regarding radComboBox. Now i have 1 radcombobox that bind with data. But i cant display my empty msg in radcombobox by using EmptyMessage="--Select--". The data display directly in my radcombobox.

    Have can i solve this problem?

    Any help is appreciated.
    Thank you.


    regards,
    Nasri
  2. Shinu
    Shinu avatar
    17764 posts
    Member since:
    Mar 2007

    Posted 28 Mar 2011 Link to this post

    Hello Nasri,

    Please make sure that you have set the RadComboBox property AllowCustomText to true.

    Thanks,
    Shinu.
  3. Arteta Sam
    Arteta Sam avatar
    31 posts
    Member since:
    Jan 2010

    Posted 30 Mar 2011 Link to this post

    Thank you for your reply. But now i using

     

     

    telerik:GridDropDownColumn, i cany find the properties that allow custom text.
    How can i do this?

    Thank you.

    regards,
    nasri

     

  4. Shinu
    Shinu avatar
    17764 posts
    Member since:
    Mar 2007

    Posted 30 Mar 2011 Link to this post

    Hello Nasri,

    Try the following code snippet  to achieve your requirment.
    C#:
    protected void RadGrid1_ItemCreated(object sender, GridItemEventArgs e)
        {
         if (e.Item is GridEditableItem && e.Item.IsInEditMode)//Check for Edit mode. Here its InPlace.
            {
                GridEditableItem editItem = (GridEditableItem)e.Item;
                RadComboBox combo = (RadComboBox)editItem["ColumnUniqueName"].Controls[0];
                combo.AllowCustomText = true;
            }
         }

    Thanks,
    Shinu.
  5. Arteta Sam
    Arteta Sam avatar
    31 posts
    Member since:
    Jan 2010

    Posted 30 Mar 2011 Link to this post

    Dear shinu,

    Thank you for your quick reply. However, this is not the result that i want. wat i want is display empty msg in my gidcolumn drop down list. Mean default the drop down list value is empty msg, not the fisrt row data . can u help me?

    Thank you.
    regards,
    nasri
  6. Shinu
    Shinu avatar
    17764 posts
    Member since:
    Mar 2007

    Posted 31 Mar 2011 Link to this post

    Hello Nasri,

    You can set the empty message by setting the EmptyMessage to the RadCombo.

    C#:
    if (e.Item is  GridEditableItem && e.Item.IsInEditMode)//Check for Edit mode. Here its InPlace.
            {
                GridEditableItem editItem = (GridEditableItem)e.Item;
                RadComboBox combo = (RadComboBox)editItem["ColumnUniqueName"].Controls[0];
                combo.AllowCustomText = true;
                combo.EmptyMessage = "SelectOne";
            }

    Thanks,
    Shinu.
  7. Arteta Sam
    Arteta Sam avatar
    31 posts
    Member since:
    Jan 2010

    Posted 01 Apr 2011 Link to this post

    Dear Shinu,

    Thank you !!! you help me alot!!!

    Again, thanks a lot!

    regards,
    Nasri
Back to Top