Click here to Skip to main content
15,891,204 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
hi sir,
i have datagrid view with check boxes.I am bind the data from two diffrent tables.I want check the check boxes automatically which data coming from particular one table
Posted
Updated 6-Jun-12 1:08am
v2
Comments
Sandeep Mewara 6-Jun-12 7:25am    
Winforms or ASP.NET? What have you tried so far?
Maciej Los 6-Jun-12 18:52pm    
Good question!

1 solution

hi,
Using ASP Template Field you can achieve it like this.
ASP.NET
<asp:templatefield headertext="IsActive" xmlns:asp="#unknown">
    <itemtemplate>
        <asp:checkbox id="chkIsActive" runat="server" headertext="IsActive">
        Checked='<%#bool.Parse(Eval("IsActive").ToString())%>' />
    </asp:checkbox></itemtemplate>
</asp:templatefield>

here IsActive is the column name which has TRUE or FALSE coming from database. if IsActive is True then it will Check the checkbox
 
Share this answer
 

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