我如何在运行时使用C#获取/访问Datagrid中的模板列名称 [英] How can I get / access template column name in Datagrid at runtime + C#

查看:112
本文介绍了我如何在运行时使用C#获取/访问Datagrid中的模板列名称的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想在asp.net 3.5的运行时获取列名(这是datagrid中的模板列),所以我写的像->

I wanted to get column name( which is template column in datagrid ) at runtime in asp.net 3.5, SO I have written like -->

string str =(((DataGridTemplateColumn)((((TemplateColumn)(DataGrid1.Columns [jCount])).ItemTemplate)).columnName;

string str = ((DataGridTemplateColumn)(((TemplateColumn)(DataGrid1.Columns[jCount])).ItemTemplate)).columnName;

但是在这里它给出了一个错误,即由于安全级别而无法访问

But here it gives error that this could not be access because of security level

那么访问此列名称的另一种方法是什么?请向我建议解决方案

So what is the another way to access this column name Please suggest me the solution

谢谢.

 

 

 

推荐答案

Hello Hardik,

 

谢谢您的发帖!  ;我建议将您的问题发布到MS论坛之一中,

Microsoft开发人员网络 > 论坛首页 > Windows窗体论坛 > Windows窗体数据控件和数据绑定
Microsoft Developer Network > Forums Home > Windows Forms Forums > Windows Forms Data Controls and Databinding


这篇关于我如何在运行时使用C#获取/访问Datagrid中的模板列名称的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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