Event of Chech Box in RadListView not working

2 posts, 0 answers
  1. Kumar
    Kumar avatar
    1 posts
    Member since:
    Jun 2012

    Posted 13 Jun 2012 Link to this post

    Hi All,

     I  have RadListView  having some data .I want to do some operation in the code behind when the checkbox in the listview is checked
     I have the code as below

    <telerik:RadListView ID="lstViewSelectedContact" runat="server" ItemPlaceholderID="pnlItemholder"
                                        OnSelectedIndexChanged="listView_SelectedIndexChanged"  Width="600px"  OnPreRender = "lstViewSelectedContact_OnPreRender"
                                        AllowMultiItemSelection="true" DataKeyNames="id"  Visible="true"   
                                        onitemcommand="lstViewSelectedContact_ItemCommand"  >
                                            <asp:Panel ID="pnlItemholder" runat="server" Height="100px"></asp:Panel>
                                                <asp:CheckBox ID="chkSelect" runat="server" AutoPostBack="true"   OnCheckedChanged="chkSelect_OnCheckedChanged" BackColor="Transparent" BorderStyle="None" Text='<%#Eval("text") %>'>                                                   
                                            <asp:CheckBox ID="chkSelectedItem" runat="server" AutoPostBack="true" BackColor="LightSkyBlue" BorderStyle="None" CommandName="Deselect" Text='<%#Eval("text") %>'>
                                            <span style="color: Black; font-weight: normal;"></span>

    The Problem is that I cant get the checked items(ID and value) in the code behind ie in chkSelect_OnCheckedChanged event.
  2. Shinu
    Shinu avatar
    17764 posts
    Member since:
    Mar 2007

    Posted 13 Jun 2012 Link to this post

    Hi Kumar,

    Try the following code to get the value of the CheckBox in code behind.

    protected void chkSelect_OnCheckedChanged(object sender, EventArgs e)
            CheckBox chk = (CheckBox)sender;

    Hope this helps.

Back to Top