CommandItemDisplay

8 posts, 0 answers
  1. mww
    mww avatar
    257 posts
    Member since:
    Sep 2012

    Posted 17 Dec 2010 Link to this post

    How can the command toolbar be set to show only the refresh button ?  I dont need the insert option.
  2. Daniel
    Admin
    Daniel avatar
    4946 posts

    Posted 17 Dec 2010 Link to this post

    Hello,

    The easiest way would be to hide the AddNewRecord button through the CommandItemSettings property:
    <CommandItemSettings ShowAddNewRecordButton="false" />

    Regards,
    Daniel
    the Telerik team
    Browse the vast support resources we have to jump start your development with RadControls for ASP.NET AJAX. See how to integrate our AJAX controls seamlessly in SharePoint 2007/2010 visiting our common SharePoint portal.
  3. UI for ASP.NET Ajax is Ready for VS 2017
  4. mww
    mww avatar
    257 posts
    Member since:
    Sep 2012

    Posted 17 Dec 2010 Link to this post

    where exactly in the grid does this go ?  Ive scrolled through the properties but cant find it
  5. mww
    mww avatar
    257 posts
    Member since:
    Sep 2012

    Posted 17 Dec 2010 Link to this post

    Ive tried putting it in various places in the grid but I get this error


    Parser Error Message: Type 'Telerik.Web.UI.RadGrid' does not have a public property named 'CommandItemSettings'.
  6. Princy
    Princy avatar
    17421 posts
    Member since:
    Mar 2007

    Posted 20 Dec 2010 Link to this post

    Hello,

    You could place the CommandItemSettings inside MasterTableView tag like below.

    ASPX:
    <MasterTableView Name="Master" runat="server" CommandItemDisplay="Top"
        CommandItemSettings-ShowAddNewRecordButton="false">

    Thanks,
    Princy.
  7. mww
    mww avatar
    257 posts
    Member since:
    Sep 2012

    Posted 20 Dec 2010 Link to this post

    Ive tried that but it doesnt work, the add button is still there.  I get an error in the ide

    Attribute CommandItemSettings-ShowAddNewRecordButton is not a valid attribute of element MasterTableView
  8. mww
    mww avatar
    257 posts
    Member since:
    Sep 2012

    Posted 20 Dec 2010 Link to this post

    Ive also tried adding this

    <CommandItemSettings ShowAddNewRecordButton="false" ShowExportToExcelButton="true" ShowExportToPdfButton="true" />

    but I get an error

    ShowAddNewRecordButton is not a valid attribute of CommandItemSettings
  9. Princy
    Princy avatar
    17421 posts
    Member since:
    Mar 2007

    Posted 21 Dec 2010 Link to this post

    Hello,

    I guess you are using older version of Telerik control. The property ShowAddNewRecordButton is available from the version  Q1 2010 BETA (version 2010.1.216). You can achieve the same by accessing the control and then setting the visibility to false. Here is the sample code.

    C#:
    protected void RadGrid1_PreRender(object sender, EventArgs e)
       {
           GridCommandItem cmdItem = (GridCommandItem)RadGrid1.MasterTableView.GetItems(GridItemType.CommandItem)[0];
           cmdItem.FindControl("InitInsertButton").Parent.Visible = false;
       }

    Thanks,
    Princy.
Back to Top
UI for ASP.NET Ajax is Ready for VS 2017