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

[Solved] Hide expand/collapse - no record

1 Answer 109 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Paul
Top achievements
Rank 1
Paul asked on 13 May 2013, 02:54 PM
Hi Community,
    Need help with the hide expand/collapse (buttontype="ImageButton").   I have look at the documentation page http://www.telerik.com/help/aspnet-ajax/grid-hide-expand-collapse-images-when-no-records.html, but it hide everything.  Because the nestedView.Items.Count always equal to zero (Not sure if I'm doing it right).

I have an attachment column if they have an attachment it show the detail (detail table) about the attachment, when they don't have an attachment I want to hide the button or disable it.

Any help would be greatly appreciated it.

See attach image.

1 Answer, 1 is accepted

Sort by
0
Paul
Top achievements
Rank 1
answered on 13 May 2013, 05:10 PM
Problem Solved:
   Added the ExpandCollapseColumn-UniqueName="colExpandCollapse" into the mastertaveview.  In the ItemDataBound for the grid (.cs) added.

ImageButton imgbtnExpander = (ImageButton)item["colExpandCollapse"].Controls[0];
imgbtnExpander.Visible = bool.Parse(((DataRowView)e.Item.DataItem)["MyDataColumn"].ToString());
Tags
Grid
Asked by
Paul
Top achievements
Rank 1
Answers by
Paul
Top achievements
Rank 1
Share this question
or