0

I have One grid say Grid 1 in which there are some columns. There is one view image button, one delete image button and one column which says that color column is Red or Blue.

If color column is Red the deleted button is hidden else its shown (Based on user given rights to delete a column or not).

Now a user clicks a view button for Red Color Column. If this condition is satisfied, then i want that delete icon should not be present in Grid 2.

Grid 2 has 2 columns. One is deleted image button and one is file name (which is uploaded via upload control).

So If in Grid One "View Image Button" is clicked for "Red" Column i should be able to hide the delete button from Grid 2.

I have tried by writing code in Item command but i am not able to access control of grid2. is this the correct way? Or else suggest me some correct way.

Please Make sure that code is compatible with VS 2003.

let me know if more inputs are needed.

Thanks

4

1 回答 1

0

grid2.Rows[<index>].Cells[<index>].FindControl("")应该可以工作,只要网格与数据绑定。

编辑:在用户控制代码隐藏中,您可以将网格公开为:

public DataGrid Grid
{
   get { return this.<gridID>; }
}

然后在页面代码隐藏中,使用以下命令访问网格:

public class SomePage : Page
{
   .. OnInit(..)
   {
       this.uc1.Grid.<props/methods>
   }
}

无论你需要做什么。您甚至可以附加到网格的事件。

于 2010-05-13T12:19:52.610 回答