网格视图标题的问题 [英] Problem With Grid View Header

查看:108
本文介绍了网格视图标题的问题的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

大家好,
我只想从按钮单击获取gridview标题行(标题在列中).

请注意,按钮位于该网格之外.

[酷]

Hi All,
Simply i want to fetch gridview header row (heading in column) from button click

note that button is outside from that grid.

[cool]

推荐答案

在按钮上单击

将字符串作为字符串

''检查是哪个的属性Cells or Items

st = Gridview1.Rows(0).Cells(0).HeaderText



st = Gridview1.Rows(0). Items(0).HeaderText

''这里的单元格(0)或Items(0)表示第0个索引列
所以您必须对所有列执行此操作,即Cells(0),Cells(1 ),Cells(2),Cells(3).....

onbutton click

dim st as String

''check which is it''s property Cells or Items

st=Gridview1.Rows(0).Cells(0).HeaderText

or

st=Gridview1.Rows(0).Items(0).HeaderText

''Here Cells(0) or Items(0) means the 0th index Column
So u have to do it for all Columns i.e.Cells(0),Cells(1),Cells(2),Cells(3).....


这篇关于网格视图标题的问题的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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