Click here to Skip to main content
15,894,106 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hi,
i am supposed to save the sate of the checkbox in gridview not based on the index of the checkbox as sorting also is happening in the girdview..pls help me out to save the checkbox based on a datakey..how do i do?
plssss
Posted

1 solution

You need to add the boolean column in the datasource to make the checkbox checked/unchecked

For eg. in asp.net page, you can bind it like this

ASP.NET
<asp:checkbox id="chkEnabled" runat="server" checked="<%# Bind("IsSelected") %>" tabindex="1" xmlns:asp="#unknown" />
 
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