Can I navigate to Next and previous grid items using buttons

2 posts, 0 answers
  1. sai
    sai avatar
    7 posts
    Member since:
    Mar 2016

    Posted 29 Apr Link to this post

    Hi Tema,

     

    I'm editing my grid vie win Popup mode,this is working fine.

    This is the sample code of edit form settings

    <EditFormSettings InsertCaption="Edit Item Template" CaptionFormatString="Edit ProjectID: {0}"
                CaptionDataField="ProjectID" EditFormType="WebUserControl"  UserControlName="~/UserControls/INGControl.ascx" PopUpSettings-ScrollBars="Auto" PopUpSettings-Modal="false"  PopUpSettings-Height="400px" PopUpSettings-Width="1000px" PopUpSettings-ZIndex="20">
                <EditColumn uniquename="EditCommandColumn1" ItemStyle-ForeColor="Blue" />
                <PopUpSettings ScrollBars="Auto" />
    </EditFormSettings>

     

    I want to place next and prev button in my edit form/user control and when use clicks on next ,I need to display next grid item details in popup/user control.

    I've a req now, where I need to load next/previous record of the grid view in popup when user clicks on next/prev button.

    Please share some samples.

    I'm using 2011 Q3 Build.

     

    Regards

    Sai Teja

  2. Eyup
    Admin
    Eyup avatar
    3015 posts

    Posted 04 May Link to this post

    Hi Sai,

    You can add the buttons inside the FormTemplate or UserControl depending on what you use:
    http://demos.telerik.com/aspnet-ajax/grid/examples/data-editing/form-template-update/defaultcs.aspx

    Alternatively, you can created and add the buttons during the ItemCreated event handler:
    http://docs.telerik.com/devtools/aspnet-ajax/controls/grid/rows/accessing-cells-and-rows#accessing-controls-in-editinsert-mode

    Using the OnClick event handler of the button, you can use something similar to this logic to achieve the requested functionality:
    protected void Button5_Click(object sender, EventArgs e)
    {
        int editIndex = int.Parse(RadGrid1.EditIndexes[0]);
        RadGrid1.EditIndexes.Clear();
        RadGrid1.EditIndexes.Add(editIndex + 1);
        RadGrid1.Rebind();
    }

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