SelfHierarchy CommandItemSettings problem

2 posts, 0 answers
  1. Barbaros Saglamtimur
    Barbaros Saglamtimur avatar
    110 posts
    Member since:
    Jul 2012

    Posted 14 Nov 2012 Link to this post

    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">
    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.
  2. Radoslav
    Radoslav avatar
    1564 posts

    Posted 19 Nov 2012 Link to this post

    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;

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

    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.
Back to Top