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

Can I navigate to Next and previous grid items using buttons

1 Answer 180 Views
Grid
This is a migrated thread and some comments may be shown as answers.
sai
Top achievements
Rank 1
sai asked on 29 Apr 2016, 11:24 AM

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

1 Answer, 1 is accepted

Sort by
0
Eyup
Telerik team
answered on 04 May 2016, 10:45 AM
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.
Tags
Grid
Asked by
sai
Top achievements
Rank 1
Answers by
Eyup
Telerik team
Share this question
or