in my web app i am taken one dropdownlist, button and chekboxList controls. and in dropdownlist items are Red, Blue, Green.
and in checkedlistbox i take items are
<asp:CheckBoxList ID="CheckBoxList1" runat="Server">
<asp:ListItem Text="Red" Value="red"></asp:ListItem>
<asp:ListItem Text="Blue" Value="blue"></asp:ListItem>
<asp:ListItem Text="Green" Value="green"></asp:ListItem>
</asp:CheckBoxList>my aim is when i am selecting Red item in dropdownlist and i click button that time Red checkbox is selected. similarly to all
please give me a solution and please give a some sample code todo this.
Thanks
Koteswararao MallisettiPosted Oct 28, 2010, 8:31 AM
and write the following code in buton click event
if (DropDownList1.SelectedIndex!= 0)
{
CheckBoxList1.SelectedIndex = DropDownList1.SelectedIndex-1;
}
all the best
M.KoteswaraRao.