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

SelfHierarchy CommandItemSettings problem

1 Answer 54 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Barbaros Saglamtimur
Top achievements
Rank 1
Barbaros Saglamtimur asked on 14 Nov 2012, 10:47 AM
Hi,
I am using SelfHierarchy within my RadGrid and would like to use Export functionality.
My CommandItemSettings are;
<CommandItemSettings ShowExportToExcelButton="true" ShowExportToWordButton="true"
 ShowExportToPdfButton="true" ShowRefreshButton="false" ShowAddNewRecordButton="false">
</CommandItemSettings>
Commands on MasterTableView are shown as expected but on details tables are not. Even ShowRefreshButton="false" ShowAddNewRecordButton="false", details table shows those buttons and hides "ExportTo...." buttons. I would like to hide all CommandButtons (or Command row) on details tables. Please refer to attached screen-shot for the unexpected behavior.

Any help would be greatly appreciated.

1 Answer, 1 is accepted

Sort by
0
Radoslav
Telerik team
answered on 19 Nov 2012, 07:49 AM
Hello Barbaros,

To achieve the desired functionality you could try using the following code snippet:
int count = 0;
protected void RadGrid1_ItemCreated(object sender, GridItemEventArgs e)
{
     if (e.Item is GridCommandItem)
     {
          if (count > 0)
          {
                e.Item.Visible = false;
          }
 
          count++;
      }
   ...
}

Please give it try and let me know if it helps you. Looking forward for your reply.

Regards,
Radoslav
the Telerik team
If you want to get updates on new releases, tips and tricks and sneak peeks at our product labs directly from the developers working on the RadControls for ASP.NET AJAX, subscribe to their blog feed now.
Tags
Grid
Asked by
Barbaros Saglamtimur
Top achievements
Rank 1
Answers by
Radoslav
Telerik team
Share this question
or