Click here to Skip to main content
13,045,657 members (65,469 online)
Rate this:
Please Sign up or sign in to vote.
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. :(

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
Updated 18-Jan-12 1:21am
Jephunneh Malazarte 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
Top Experts
Last 24hrsThis month

Advertise | Privacy | Mobile
Web02 | 2.8.170713.1 | Last Updated 18 Jan 2012
Copyright © CodeProject, 1999-2017
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