ASP.NET 2.0 – 带有tbody / thead的DataGrid
发布时间:2020-05-25 11:11:54 所属栏目:asp.Net 来源:互联网
导读:有没有办法让DataGrid控件呈现tbody和thead HTML元素? 虽然我喜欢“user186197”的答案,但该博客文章使用反射,但在非完全信任的托管环境中可能会出错.这是我们使用的,没有黑客: public class THeadDataGrid : System.Web.UI.WebControls.DataGrid{ protecte
|
有没有办法让DataGrid控件呈现tbody和thead HTML元素? 解决方法虽然我喜欢“user186197”的答案,但该博客文章使用反射,但在非完全信任的托管环境中可能会出错.这是我们使用的,没有黑客:public class THeadDataGrid : System.Web.UI.WebControls.DataGrid
{
protected override void OnPreRender(EventArgs e)
{
this.UseAccessibleHeader = true; //to make sure we render TH,not TD
Table table = Controls[0] as Table;
if (table != null && table.Rows.Count > 0)
{
table.Rows[0].TableSection = TableRowSection.TableHeader;
table.Rows[table.Rows.Count - 1].TableSection = TableRowSection.TableFooter;
}
base.OnPreRender(e);
}
} (编辑:安卓应用网) 【声明】本站内容均来自网络,其相关言论仅代表作者个人观点,不代表本站立场。若无意侵犯到您的权利,请及时与联系站长删除相关内容! |
相关内容
- asp.net – 通过邮件发送wcf服务消费表单数据
- ASP.NET中继器模板,每第N个元素的条件代码
- 如何合理地构建我的ASP.NET MVC 2项目与区域
- asp.net-mvc – 在ASP.NET MVC 5应用程序中启用SSL会导致Op
- asp.net-mvc – System.Web.Mvc.WebViewPage.Model.get返回
- asp.net-mvc – AntiForgeryToken在ASP.Net MVC 4 RC中弃用
- 使用asp.net和vb.net从sql server导出到excel文件?
- 如何在ASP.NET MVC中手动设置用户的角色?
- asp.net – 如何将转发器绑定到列表以更新绑定的项目? (2种
- asp.net – Web.config允许特定用户的位置访问
推荐文章
站长推荐
热点阅读
