How to Get The Checked Values in ListBox

3 posts, 0 answers
  1. Suresh K
    Suresh K avatar
    68 posts
    Member since:
    Apr 2009

    Posted 27 Oct 2009 Link to this post

    hi.
    I have ListBox With checkBox=True.
    <telerik:RadListBox ID="RLBLedgerList" runat="server" CheckBoxes="true" Style="position: static; height:120px; overflow:scroll;" 
            Width="492px" Skin="Hay" BorderColor="#4EB106" BorderWidth="1px"
    </telerik:RadListBox> 
    And bind data to The RadListBox.
    RadListBox1.DataSource = ds
            RadListBox1.DataValueField = "id"
            RadListBox1.DataTextField = "ledgname"
            RadListBox1.DataBind().

    But  can't able to get the Checked value.,

    Can Any one help me.how to get the checked values.
    I am using vb codeing.

    Thank you
    Suresh K.


  2. Shinu
    Shinu avatar
    17764 posts
    Member since:
    Mar 2007

    Posted 27 Oct 2009 Link to this post

    Hi Suresh,

    Try the following code snippet in order to get the checked item values in code behind.

    VB:
     
    Protected Sub Button3_Click(ByVal sender As ObjectByVal e As EventArgs) 
        For Each item As RadListBoxItem In RadListBox1.CheckedItems 
            Dim value As String = item.Value.ToString() 
            'Response.Write(value) 
        Next 
    End Sub 
     

    -Shinu.
  3. Suresh K
    Suresh K avatar
    68 posts
    Member since:
    Apr 2009

    Posted 27 Oct 2009 Link to this post

    hi.
    Thanks for ur Response.
    I tryed this but it showing checkeditems length=0.
    it doesn't go to loop.
    Can you tell me Any Other way. please............


    Thank You

    Suresh K.
Back to Top