要在分页和排序设置为true的情况下将复选框状态保存在gridview中 [英] To save the checkbox state in gridview with paging and sorting set as true

查看:71
本文介绍了要在分页和排序设置为true的情况下将复选框状态保存在gridview中的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述


我应该在网格视图中保存复选框的状态,而不是基于复选框的索引,因为在girdview中也会发生排序..pls帮助我根据数据键保存复选框..我该怎么办?
plssss

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

推荐答案

您需要在数据源中添加布尔列,以使复选框处于选中状态/未选中状态

例如.在asp.net页面中,您可以像这样绑定它

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


这篇关于要在分页和排序设置为true的情况下将复选框状态保存在gridview中的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆