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

Set defualt drop down values in Edit form

1 Answer 55 Views
Scheduler
This is a migrated thread and some comments may be shown as answers.
Manmeet
Top achievements
Rank 1
Manmeet asked on 09 Aug 2010, 05:24 AM
Hi

i am new to telerik controls but enjoying working on these controls.

during the development i stuck at a point, where i need to set default dropdown values in edit form. Here is the sample code
<label for='<%= PriorityDropDown.ClientID %>'>
    Priority:</label><%--
        Leaving a newline here will affect the layout, so we use a comment instead.
                            --%>
    <telerik:RadComboBox runat="server" ID="PriorityDropDown" Skin='<%# Owner.Skin %>' Width="100px" AutoPostBack="true">
            <Items>
                    <telerik:RadComboBoxItem Text="Low" Value="Low" Selected='<%# Convert.ToBoolean((Convert.ToString(Eval("Priority")) == "Low")) %> ' />
                    <telerik:RadComboBoxItem Text="Medium" Value="Medium" Selected='<%# Convert.ToBoolean((Convert.ToString(Eval("Priority")) == "Medium")) %> ' />
                    <telerik:RadComboBoxItem Text="High" Value="High" Selected='<%# Convert.ToBoolean((Convert.ToString(Eval("Priority")) == "High")) %> ' />
            </Items>
    </telerik:RadComboBox>

I have added Priority attribute in custom names collection like : CustomAttributeNames="Priority"
Whenever i write 
<%(Convert.ToString(Eval("Priority")) == "Low") %>

it gives me "True" string but when i convert it to Boolean value It always give me false. please help me to sort out this problem.

Regards
Manmeet Singh

1 Answer, 1 is accepted

Sort by
0
Peter
Telerik team
answered on 10 Aug 2010, 01:51 PM
Hi Manmeet,

You need to store and read the selected value in a custom attribute as in this kb article:
http://www.telerik.com/support/kb/aspnet-ajax/scheduler/implement-related-radcombobox-controls-in-the-advanced-form.aspx

Kind regards,
Peter
the Telerik team
Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items
Tags
Scheduler
Asked by
Manmeet
Top achievements
Rank 1
Answers by
Peter
Telerik team
Share this question
or