CheckBoxBoxList outside a DataList!!

  • Thread starter Patrick Olurotimi Ige
  • Start date
P

Patrick Olurotimi Ige

I have this checkboxlist out side a Datalist below:-

<asp:checkboxlist id="chkList" AutoPostBack="True" Runat="server"
DataValueField="ProductFeatureID"
DataTextField="Feature"
OnSelectedIndexChanged="Check_Clicked"></asp:checkboxlist></

And the event that fires after when the checkBoxList is clicked
-------------------------------------------------------
Sub Check_Clicked(ByVal sender As Object, ByVal e As EventArgs) Handles
chkList.SelectedIndexChanged
'print.Text = "Selected Item(s):<br><br>"
Dim i As Integer
For i = 0 To chkList.Items.Count - 1
If chkList.Items(i).Selected Then
P &= "_" & chkList.Items(i).Value
'Tested it here to print it to the screen
print.Text = P & "<br>"
End If
Next

End Sub


This is my link below in the DataList( What i want to get is the value
selected below which is ok but after selecting a checkbox i want to
append only the checbox value the user has selected but i noticed that
after the Check_Clicked fires i can't get the right values appended to
the link.

Any help please?
 
K

Kim Quigley

I read somewhere that with the CheckBoxList, it's not possible to figure out
which box was actually clicked. Maybe instead of binding your data to a
CheckBoxList, you could bind to a datalist of checkboxes? I could be
wrong...
 
P

Patrick Olurotimi Ige

thx kim for the reply.
i have been looking for a solution but not found any concrete ones.maybe
you are right.
And do you have the link where you read it from?
And when you say i could bind to a datalist of checkboxes how can i do
that and what do you mean?
Becos i also have a scenario were i binded the ChecKBoxList in a
Datalist and i did that using OnItemDataBound.
But still hasn't figured out which box was acually clicked so that i
can retrieve the values/Selected Item.
If you have more info please post it
Thanks
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,982
Messages
2,570,190
Members
46,740
Latest member
AdolphBig6

Latest Threads

Top