Click here to Skip to main content
11,582,850 members (75,054 online)
Rate this: bad
Please Sign up or sign in to vote.
See more: ASP.NET checkbox VB.NET , +
hope u r doing well.

I have a listview with two sqldatasource outside. Inside the listview there is a label and a checkboxlist. The label is to display the category titles. I wanna databind the each checkboxlist to its coressponding data. I don't know how to do. Please explain me with abit of code as i am a beginner developer. Thanks so much for your help. I googled alot and found people with same problems and others solutions to their problems. But i don't know how to re-use those solution in my program. Frown | :(

That's the code i have. I don't have anything in codebehind. With this code, it shows the data with different categories but all the checkboxlists show same thing, which is right for the first checkboxlist. Thanks so much again.

 <asp:ListView ID="ListView1" runat="server" DataSourceID="ListViewSqlDataSource" >
            <asp:Label ID="CategoryNameLabel" runat="server"><%# Eval("CategoryName") %></asp:Label>
            <asp:CheckBoxList ID="CheckBoxList1" runat="server" DataSourceID="SqlDataSource1" DataValueField="SortOrder" DataTextField="DocumentName">
    <asp:SqlDataSource ID="ListViewSqlDataSource" runat="server" ConnectionString="<%$ xxx:xxx %>" 
        SelectCommand="EXEC [Docs].[CategoryList] @UserName = 8882074, @Service = 9">
            <asp:Parameter DefaultValue="8882074" Name="UserName" />
            <asp:Parameter DefaultValue="9" Name="Service" />
      <asp:SqlDataSource ID="SqlDataSource1" runat="server" ConnectionString="<%$ xxx:xxx;" 
        SelectCommand="EXEC Docs.[DocumentList] @UserName = 8882074, @Service = 9,  @YearGroup = NULL, @Category = 1">
            <asp:Parameter DefaultValue="8882074" Name="UserName" />
            <asp:Parameter DefaultValue="9" Name="Service" />
            <asp:Parameter DefaultValue="1" Name="YearGroup" />
            <asp:Parameter DefaultValue="1" Name="Category" />
Posted 18-Jan-12 1:20am
Edited 18-Jan-12 1:21am
Jephunneh Malazarte at 19-Jan-12 1:39am
see answer to your post in forum.

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

  Print Answers RSS
0 OriginalGriff 365
1 Sergey Alexandrovich Kryukov 220
2 virusstorm 209
3 Kornfeld Eliyahu Peter 165
4 Andy Lanng 139
0 OriginalGriff 1,403
1 Sergey Alexandrovich Kryukov 970
2 Abhinav S 696
3 F-ES Sitecore 505
4 Suvendu Shekhar Giri 503

Advertise | Privacy | Mobile
Web03 | 2.8.150603.1 | Last Updated 18 Jan 2012
Copyright © CodeProject, 1999-2015
All Rights Reserved. Terms of Service
Layout: fixed | fluid

CodeProject, 503-250 Ferrand Drive Toronto Ontario, M3C 3G8 Canada +1 416-849-8900 x 100