This is a migrated thread and some comments may be shown as answers.

Imagebutton in Hirerchical Radgrid Detailview

1 Answer 62 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Amol
Top achievements
Rank 2
Amol asked on 30 Jun 2009, 02:53 PM
Hello Friends,

I have a Hierarchical Rad grid which contains 4 level of Hierarchy.

On the 2nd, 3rd and 4th Hierarchy of grid, there is a template column which contains one imagebutton.

My requirement is to hide the imagebutton on the last row of  each hierarchical grid.

I had tried on Page_Pre-render event using

              ImageButton downButtonPosition = (ImageButton)radgrid.MasterTableView.DetailTables[0].Items[radgrid.MasterTableView.DetailTables[0].Items.Count - 1].FindControl("ibtnDown");

Now to retrieve last row of DetailTable of Radgrid and On Which event i can get it?

Thanks in Advance

1 Answer, 1 is accepted

Sort by
0
Shinu
Top achievements
Rank 2
answered on 01 Jul 2009, 04:48 AM
Hi Amol,

You can access ImageButton for the last row of the desired table level in the ItemDataBound event  and hide it as shown below.

CS:
 
  protected void RadGrid1_ItemDataBound(object sender, GridItemEventArgs e) 
    { 
       if((e.Item is GridDataItem)&&(e.Item.OwnerTableView.Name=="Detail")&&(e.Item.ItemIndex==RadGrid1.MasterTableView.Items.Count-1)) 
        { 
            GridDataItem item = (GridDataItem)e.Item; 
            ImageButton imgbtn = (ImageButton)item.FindControl("ImageButton1"); 
            imgbtn.Visible = false
        } 
      
    } 


Thanks
Shinu
Tags
Grid
Asked by
Amol
Top achievements
Rank 2
Answers by
Shinu
Top achievements
Rank 2
Share this question
or