Click here to Skip to main content
15,888,351 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
hi all

i need help in this Scenario for use checkbox in datalist .

if i checked any checkbox in datalist will display in label .

on othermean if i checked directly i see result in label then if checked another the result extend in label.

i know how to use checkbox in datalist but with buttn click or select btn .

i do not need use any btn .

ASP.NET
<pre><table>
    <tr>
    <td>
        <asp:DataList ID="DataList1" runat="server" 
        
            DataSourceID="SqlDataSource1">
            <ItemTemplate>
                <asp:CheckBox ID="CheckBox1" runat="server" />
        
                <br />
                person_no:
                <asp:Label ID="personnoLabel" runat="server" Text='<%# Eval("person_no") %>' />
                <br />
                person_name:
                <asp:Label ID="nameLabel" runat="server" Text='<%# Eval("person_name") %>' />
                <br />
                Country_no:
                <asp:Label ID="countrynoLabel" runat="server" 
                    Text='<%# Eval("Country_no") %>' />
                <br />
<br />
            </ItemTemplate>
            <SelectedItemTemplate>
                label
            </SelectedItemTemplate>
        </asp:DataList>
    </td>
    <td>

    
    </td>
    
    </tr>
    <tr>
    <td>
        <asp:SqlDataSource ID="SqlDataSource1" runat="server" ConnectionString="<%$ ConnectionStrings:mydbConn %>"
            SelectCommand="SELECT top(3) * FROM [anytable]"></asp:SqlDataSource>
 
        <asp:Label ID="Label4" runat="server" Text="Label"></asp:Label>
    </td>
    
    </tr>
    <tr>
    <td>

     
         </td>
    
    </tr>
    
    
    </table>


What I have tried:

how to use checkbox in datalist without select button
Posted
Updated 16-Jan-17 17:59pm
v2
Comments
khalid1980 16-Jan-17 15:02pm    
i need help about my question , i need to deal with checkbox in datalist .

you can anyone who have experience in control to help me .

you can test if check any checkbox thr item goes to gridview in samepage , if uncheck any

item will remove from gridview . remember , i don't need use any button .

1 solution

You want to say that:top 3 items selected from database should be checked.Am I right?
 
Share this answer
 
Comments
khalid1980 17-Jan-17 9:55am    
you can use gridview , if i checked any item will goes to gridview , if i uncheck will remove from grideview .

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



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900