如何在gridview中隐藏选定的行
问题描述:
我有两个网格视图
在第一个网格视图中包含一些带有选择按钮的记录。
当我在第一个选择特定记录时
网格视图使用选择按钮,然后记录剩余记录将进入第二个网格视图。
如何编写该代码...
I have two grid views
In 1st grid view contains some records with select button.
when I select particular record on 1st grid view using select button then except that record remaining records will come in 2nd grid view.
How to write code for that one...
答
使用行命令事件
Use row command event
protected void GridView1_RowCommand(object sender, GridViewCommandEventArgs e)
{
if (e.Row.Cells[2].Text == "Select")
e.Row.Visible = false;
}
或
使用此
Or
Use this
Gridview1.Rows.Item(i).Attributes.Add("style", "display:none")
Hope这会对你有所帮助......
Hope this will help you...