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

[Solved] dropdownlist loding value automatically

1 Answer 130 Views
DropDownList
This is a migrated thread and some comments may be shown as answers.
Gokul
Top achievements
Rank 1
Gokul asked on 26 Apr 2013, 01:44 PM
i have two dropdownlist in that one dropdownlist connected with stored procedure it contains data textfield is cellname and data valuefield is cellid based on cellid the second dropdownlist displays zone name.  in second dropdownlist contains list of values. after selecting the value and button click event performed. if button clicked, default first value is loaded.

1 Answer, 1 is accepted

Sort by
0
Shinu
Top achievements
Rank 2
answered on 08 May 2013, 08:22 AM
Hi Gokul,

I guess you want to display the DefaultMessage of the second RadDropDownList on button click. Please check the following C# code I tried which works fine at my end.

ASPX:
<telerik:RadDropDownList ID="RadDropDownList1" runat="server" DefaultMessage="Please Select">
    <Items>
        <telerik:DropDownListItem runat="server" Text="Item 1" />
        <telerik:DropDownListItem runat="server" Text="Item 2" />
        <telerik:DropDownListItem runat="server" Text="Item 3" />
    </Items>
</telerik:RadDropDownList>
<asp:Button ID="Button1" runat="server" Text="Clear" OnClick="Button1_Click" />

C#:
protected void Button1_Click(object sender, EventArgs e)
{
    RadDropDownList1.SelectedIndex = -1;
}

Thanks,
Shinu.
Tags
DropDownList
Asked by
Gokul
Top achievements
Rank 1
Answers by
Shinu
Top achievements
Rank 2
Share this question
or