I am using two listboxes with a finish button, I want to clear the selection in the first list box in the SelectedIndexChanged client side event of second listbox and viceversa, below is the code.
<script language="javascript" type="text/javascript">
function ExistingonSelectedIndexChanged(sender, args)
{
var listbox = $find("<%= lstAvailablePlans.ClientID %>");
listbox.trackChanges();
listbox.clearSelection();
listbox.commitChanges();
}
function AvailableonSelectedIndexChanged(sender, args)
{
var listbox = $find("<%= lstExistingPlans.ClientID %>");
listbox.trackChanges();
listbox.clearSelection();
listbox.commitChanges();
}
</script>
<table cellpadding="2" cellspacing="2" border="0" class="TableBorder" width="100%">
<tr valign="top">
<td style="width: 105px"> </td>
<td class="clsLabel">
<asp:Label id="lblExisting" runat="server" text="<%$ Resources:pageLabels, lblExistingPlans %>" CssClass="clsLabel"></asp:Label>
</td>
<td style="width: 100px"> </td>
</tr>
<tr valign="top">
<td style="width: 105px"> </td>
<td>
<telerik:RadListBox ID="lstExistingPlans" runat="server" Width="763px" Height="250px" CssClass="clsLable" Skin="Office2007" OnClientSelectedIndexChanged="ExistingonSelectedIndexChanged"></telerik:RadListBox>
</td>
<td style="width: 100px"> </td>
</tr>
<tr valign="top">
<td style="width: 105px"> </td>
<td class="clsLabel">
<asp:Label id="lblAvailable" runat="server" text="<%$ Resources:pageLabels, lblAvailablePlans %>" CssClass="clsLabel"></asp:Label>
</td>
<td style="width: 100px"> </td>
</tr>
<tr valign="top">
<td style="width: 105px"> </td>
<td>
<telerik:RadListBox ID="lstAvailablePlans" runat="server" Width="763px" Height="250px" CssClass="clsLable" Skin="Office2007" OnClientSelectedIndexChanged="AvailableonSelectedIndexChanged"></telerik:RadListBox>
</td>
<td style="width: 100px"> </td>
</tr>
</table>
I could able to clear the selection in first listbox on SelectedIndexChanged client event of second list box and vice versa, but the problem is
1. I select one record in the first list box
2. Then I select one record in the second list box
3. Then the selection in the first list box goes off and selection the second list box shows
4. when i click on finish button and at the sever side when i try to access the second list box selected count is 1 and also the first list box selected count is 1 even though i have cleared it in the client side.
Kindly let me know how to fix this issue or wheather its a bug?
Regards,
Santhosh