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

How to Get The Checked Values in ListBox

2 Answers 306 Views
ListBox
This is a migrated thread and some comments may be shown as answers.
Suresh K
Top achievements
Rank 1
Suresh K asked on 27 Oct 2009, 05:30 AM
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 Answers, 1 is accepted

Sort by
0
Shinu
Top achievements
Rank 2
answered on 27 Oct 2009, 06:42 AM
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.
0
Suresh K
Top achievements
Rank 1
answered on 27 Oct 2009, 07:02 AM
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.
Tags
ListBox
Asked by
Suresh K
Top achievements
Rank 1
Answers by
Shinu
Top achievements
Rank 2
Suresh K
Top achievements
Rank 1
Share this question
or