开发者

How do I perform an action on a gridview column only if it exists?

开发者 https://www.devze.com 2022-12-11 11:46 出处:网络
I have a gridview which is in a usercontrol on a page. The gridview displays data based on whatever the calling page tells it to, which may or may not include certain columns.

I have a gridview which is in a usercontrol on a page. The gridview displays data based on whatever the calling page tells it to, which may or may not include certain columns.

I want to tell the gridview how to format the columns if they're present on the page, but I also need it to ignore all the formatting if the column doesn't exist.. I already know how to format them, so I guess I just need a method to determine if they're there, and where they are in the 开发者_运维技巧gridview.


It sounds like you need to be creating everything dynamically in your code-behind to achieve this kind of granularity. This should help.

0

精彩评论

暂无评论...
验证码 换一张
取 消