Trigger edit from a GridTemplateColumn

4 posts, 0 answers
  1. Jeremy
    Jeremy avatar
    29 posts
    Member since:
    Apr 2014

    Posted 16 May Link to this post

    I am currently using a RadGrid to display a list of events and documents.  One of the columns in the grid is called "Action" with a few links in it (a link to the document, a link to a 3rd party annotation tool, etc).  The user wants the ability to rename the document (using the grid's edit functionality) but wants the "Rename" link to be in the Action column instead of it's own column.  How do I add a GridEditCommandColumn-like action to another column or add other columns to the GridEditCommandColumn.

     

    <telerik:GridTemplateColumn HeaderText="Actions" HeaderStyle-HorizontalAlign="Left" ItemStyle-HorizontalAlign="Left">
        <ItemTemplate>
            <asp:HyperLink runat="server" Target="_blank" ID="ViewLink" Text="View" NavigateUrl="/ViewCaseDoc.aspx?" />
            <asp:LinkButton runat="server" ID="AnnotationOpenLink" Text="Annotate" />
            <%-- 
                I want this action here
                <telerik:GridEditCommandColumn UniqueName="EditCommandColumn"  EditText="Rename"></telerik:GridEditCommandColumn>
            --%>
        </ItemTemplate>
    </telerik:GridTemplateColumn>
  2. Eyup
    Admin
    Eyup avatar
    3013 posts

    Posted 19 May Link to this post

    Hi Jeremy,

    Just set the CommandName of the LinkButton to Edit:
    http://docs.telerik.com/devtools/aspnet-ajax/controls/grid/control-lifecycle/command-reference-

    I hope this will prove helpful.

    Regards,
    Eyup
    Telerik
    Do you need help with upgrading your ASP.NET AJAX, WPF or WinForms projects? Check the Telerik API Analyzer and share your thoughts.
  3. UI for ASP.NET Ajax is Ready for VS 2017
  4. Jeremy
    Jeremy avatar
    29 posts
    Member since:
    Apr 2014

    Posted 19 May Link to this post

    Ok, that works.

    I guess at this point the only other issue is how the Edit seems to work.  So the RadGrid has nearly 100 records in it.  The user has to scroll down to find the row they want to edit.  But when they click the edit button the page posts back and the user is at the top of the radgrid again.  How do we keep or return the screen to the edit row so the user doesn't have to scroll and find the row again?

  5. Eyup
    Admin
    Eyup avatar
    3013 posts

    Posted 24 May Link to this post

    Hello Jeremy,

    Generally, you can preserve the scrolling position by ajaxifying the grid using RadAjaxManager or RadAjaxPanel.

    Alternatively, you can scroll the window to the edited item manually. I am sending a sample RadGrid web site to demonstrate how you can achieve this requirement. Please run the attached application and let me know if it helps you.

    Regards,
    Eyup
    Telerik
    Do you need help with upgrading your ASP.NET AJAX, WPF or WinForms projects? Check the Telerik API Analyzer and share your thoughts.
Back to Top