This is a migrated thread and some comments may be shown as answers.

GridDropDwonColumn displays default

6 Answers 79 Views
Grid
This is a migrated thread and some comments may be shown as answers.
ManniAT
Top achievements
Rank 2
ManniAT asked on 13 Jul 2009, 06:56 PM
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

6 Answers, 1 is accepted

Sort by
0
Lubomir
Top achievements
Rank 2
answered on 14 Jul 2009, 01:11 AM
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
0
Nikolay Rusev
Telerik team
answered on 16 Jul 2009, 12:33 PM
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.
0
ManniAT
Top achievements
Rank 2
answered on 16 Jul 2009, 12:44 PM
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
0
Lubomir
Top achievements
Rank 2
answered on 16 Jul 2009, 08:04 PM
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
0
Accepted
Nikolay Rusev
Telerik team
answered on 22 Jul 2009, 07:29 AM
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.
0
ManniAT
Top achievements
Rank 2
answered on 22 Jul 2009, 09:06 AM
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
Tags
Grid
Asked by
ManniAT
Top achievements
Rank 2
Answers by
Lubomir
Top achievements
Rank 2
Nikolay Rusev
Telerik team
ManniAT
Top achievements
Rank 2
Share this question
or