查找GridView列的字段类型(Finding the field type of GridView column)

编程入门 行业动态 更新时间:2024-10-28 19:29:14
查找GridView列的字段类型(Finding the field type of GridView column)

我正在开发一个ASP.NET页面,该页面会变换为提供给它的MDB文件。 它目前允许您选择要使用的表,并从那里编辑要编辑的行,并使用文本框填充页面并使用数据填充它们。 这一切都有效,但是当它不是基于字符串的字段类型时会出现问题,例如,我遇到的问题是确定目标单元格何时是CheckBoxField类型。

我的问题是,如何从填充的GridView获取列Web控件值?

I'm working on an ASP.NET page that mutates to the MDB file fed to it. It currently allows you to choose a table to work with, and from there what row to edit, and fills the page with text boxes and fills them with data. This all works but it poses a problem when it isn't a string based field type, for example, what I have a problem with is determining when the cell being targeted is a CheckBoxField type.

My question would be, how can you get the column web control value from a filled GridView?

最满意答案

你有权使用桌子吗? 您可以尝试从列集合中获取类型(table.Columns [name] .DataType(从我的头顶)

然后,您可以使用列类型来选择控件。

Do you have access to the table? You can try getting the type fron the column collection (table.Columns[name].DataType (from the top of my head)

You can then use the column type to select a control.

更多推荐

本文发布于:2023-08-06 21:43:00,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/1457686.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:字段   类型   GridView   Finding   column

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!