GridDropDwonColumn displays default

7 posts, 1 answers
  1. ManniAT
    ManniAT avatar
    877 posts
    Member since:
    Nov 2003

    Posted 13 Jul 2009 Link to this post

    Hi,

    I have a grid with a dropdowncolumn.
    It works as expected - except in the situation when the "ID" is not available in the values list.

    In this case the dropdown does not display "nothing" - instead it shows the first entry.
    In "edit mode" I can understand this - it is some kind of a default.
    But in display mode - where the content is rendered as some kind of text it is unexpected to display a "assumed value".

    Regards

    Manfred
  2. Lubomir
    Lubomir avatar
    2 posts
    Member since:
    Mar 2008

    Posted 13 Jul 2009 Link to this post

    I have struggled with similar problem and the same object. In a grid environment when I use GridDropDownColumn within grid if the table source of the grid is empty then the GriDropDownColumn displays empty list even and at the moment the drop down table has a number of values. When I add at least one record manually - then the grid table starts to work adequately. Also when I open the grid the first record is always with empty values if they are from drop down column. The second record and others are OK. Even the first is OK but it has to be refreshed.
    Any comments? Is a way to put default value of the GridDropDownColumn in order to avoid the problem with starting and empty table?

    Lubo
  3. UI for ASP.NET Ajax is Ready for VS 2017
  4. Nikolay Rusev
    Admin
    Nikolay Rusev avatar
    2284 posts

    Posted 16 Jul 2009 Link to this post

    Hi all,

    GridDropDownColumn has property that will enable empty item in RadComboBox/DropDownList : EnableEmptyListItem="true".

    By default the value and text of that item will be empty string, however you can change both value/text by setting the following properties:
    EmptyListItemText="some text" EmptyListItemValue="some value".

    Kind regards,
    Nikolay
    the Telerik team

    Instantly find answers to your questions on the new Telerik Support Portal.
    Check out the tips for optimizing your support resource searches.
  5. ManniAT
    ManniAT avatar
    877 posts
    Member since:
    Nov 2003

    Posted 16 Jul 2009 Link to this post

    Hi Nikolay,

    sorry that I haven't been precise enough.
    I know this property - BUT - this brings also an empty item in edit mode.
    And this means - again code behind to fix the things - because in edit mode I don't want an empty item.
    Else it would mean that I have to check if the user choose something else than this "empty item".

    Anyhow - thank you for the answer.

    Regards

    Manfred
  6. Lubomir
    Lubomir avatar
    2 posts
    Member since:
    Mar 2008

    Posted 16 Jul 2009 Link to this post

    Hi Nikolay,
    I know this property too. My problem is somewhat different.
    I have recors in Dropdownmenu that is connected to sql source table with enough records. In a table that is connected with Radgrid object I do not have any records. in this case when I choose to add an record in Radgrid object the dropdown does not show the records from the linked table.
    When I add at least one object the dropdown is working good.
    My environment is MS VS 2008, NET.3.5, RadGrid - 2009.1.527.35
    Thanks,
    Lubo
  7. Answer
    Nikolay Rusev
    Admin
    Nikolay Rusev avatar
    2284 posts

    Posted 22 Jul 2009 Link to this post

    Guys, you can check the bottom of the following help article that explains how you can set default values for the insert item only in RadGrid. You can use the approach to set default value and for the GridDropDownColumn:
    http://www.telerik.com/help/aspnet-ajax/grdinsertingvaluesinplaceandeditforms.html

    @Lubomir: DropDown control in RadGrid insert item will be populated even if the RadGrid is bound to empty collection. For your convenience I am attaching sample project demonstrating this case.

    Best wishes,
    Nikolay
    the Telerik team

    Instantly find answers to your questions on the new Telerik Support Portal.
    Check out the tips for optimizing your support resource searches.
  8. ManniAT
    ManniAT avatar
    877 posts
    Member since:
    Nov 2003

    Posted 22 Jul 2009 Link to this post

    Hi,

    this is no longer a GridDropDownColumn - to solve it with a template... no problem.
    And for that scenario I've built that solution:
    http://www.telerik.com/community/forums/aspnet-ajax/grid/radcombobox-label-in-gridtemplate.aspx

    In other words - NO GridDropDownColumn can't be set to "ShowNothingIFNothingIsThere mode" :)

    Regards

    Manfred
Back to Top
UI for ASP.NET Ajax is Ready for VS 2017