Hi Team,
User Action : User will do a single click and modify the cells and he will go the next page of the RadGrid by click on the pager. User will modify the values in the next page and so on and when user comes back to the previous page the user should see the modified values. There should not be any popup or any warning when the user moves from one page to another page using pager.
How to get the modified values or modified rows with values before the user moves another pager using the pager of the RaGrid in the codebehind ? Is there any event where we can get the modified rows?
.ASPX Content:
<form id="form1" runat="server">
<telerik:RadScriptManager ID="ScriptManager1" runat="server" EnableTheming="True">
<Scripts>
<asp:ScriptReference Assembly="Telerik.Web.UI" Name="Telerik.Web.UI.Common.Core.js">
</asp:ScriptReference>
<asp:ScriptReference Assembly="Telerik.Web.UI" Name="Telerik.Web.UI.Common.jQuery.js">
</asp:ScriptReference>
<asp:ScriptReference Assembly="Telerik.Web.UI" Name="Telerik.Web.UI.Common.jQueryInclude.js">
</asp:ScriptReference>
</Scripts>
</telerik:RadScriptManager>
<div>
<br />
<div>
Click the button to load the Student data</div>
<br />
<telerik:RadButton ID="btnLoadStudent" runat="server" Text="Load Student" OnClick="btnLoadStudent_Click">
</telerik:RadButton>
<br />
<br />
<div style="color: #800080">
The below grid uses BatchEdit Mode: (BatchEditingSettings EditType="Cell" )</div>
<br />
<telerik:RadGrid ID="rgStudent" runat="server" AllowPaging="True" AllowSorting="True" PageSize="4" AutoGenerateColumns="False" GridLines="Both" OnPageIndexChanged="rgStudent_PageIndexChanged" Width="673px">
<MasterTableView EditMode="Batch" DataKeyNames="StudentID" >
<BatchEditingSettings EditType="Cell" />
<RowIndicatorColumn Visible="False">
</RowIndicatorColumn>
<ExpandCollapseColumn Created="True">
</ExpandCollapseColumn>
<Columns>
<telerik:GridTemplateColumn DataField="StudentID" DataType="System.Byte" FilterControlAltText="Filter StudentID column" HeaderText="StudentID" SortExpression="StudentID" UniqueName="StudentID">
<%-- <EditItemTemplate>
<asp:TextBox ID="StudentIDTextBox" runat="server" Text='<%# Bind("StudentID") %>'></asp:TextBox>
</EditItemTemplate>--%>
<ItemTemplate>
<asp:Label ID="StudentIDLabel" runat="server" Text='<%# Eval("StudentID") %>'></asp:Label>
</ItemTemplate>
</telerik:GridTemplateColumn>
<telerik:GridTemplateColumn DataField="StudentName" FilterControlAltText="Filter StudentName column" HeaderText="StudentName" SortExpression="StudentName" UniqueName="StudentName">
<EditItemTemplate>
<asp:TextBox ID="StudentNameTextBox" runat="server" Text='<%# Bind("StudentName") %>' Width="75px"></asp:TextBox>
</EditItemTemplate>
<ItemTemplate>
<asp:Label ID="StudentNameLabel" runat="server" Text='<%# Eval("StudentName") %>'></asp:Label>
</ItemTemplate>
</telerik:GridTemplateColumn>
<telerik:GridTemplateColumn DataField="Mark" DataType="System.Byte" FilterControlAltText="Filter Mark column" HeaderText="Mark" SortExpression="Mark" UniqueName="Mark">
<EditItemTemplate>
<asp:TextBox ID="MarkTextBox" Width="75px" runat="server" Text='<%# Bind("Mark") %>'></asp:TextBox>
</EditItemTemplate>
<ItemTemplate>
<asp:Label ID="MarkLabel" runat="server" Text='<%# Eval("Mark") %>'></asp:Label>
</ItemTemplate>
</telerik:GridTemplateColumn>
<telerik:GridTemplateColumn DataField="Grade" FilterControlAltText="Filter Grade column" HeaderText="Grade" SortExpression="Grade" UniqueName="Grade">
<EditItemTemplate>
<asp:TextBox ID="GradeTextBox" Width="75px" runat="server" Text='<%# Bind("Grade") %>'></asp:TextBox>
</EditItemTemplate>
<ItemTemplate>
<asp:Label ID="GradeLabel" runat="server" Text='<%# Eval("Grade") %>'></asp:Label>
</ItemTemplate>
</telerik:GridTemplateColumn>
<telerik:GridTemplateColumn DataField="Phone" FilterControlAltText="Filter Phone column" HeaderText="Phone" SortExpression="Phone" UniqueName="Phone">
<EditItemTemplate>
<asp:TextBox ID="PhoneTextBox" Width="75px" runat="server" Text='<%# Bind("Phone") %>'></asp:TextBox>
</EditItemTemplate>
<ItemTemplate>
<asp:Label ID="PhoneLabel" runat="server" Text='<%# Eval("Phone") %>'></asp:Label>
</ItemTemplate>
</telerik:GridTemplateColumn>
</Columns>
</MasterTableView>
</telerik:RadGrid>
</div> <br/>
<div>
User Action : User will do a single click and modify the cells and he will go the next page of the RadGrid by click on the pager. User will modify the values in the next page and so on and when user comes back to the previous page the user should see the modified values. There should not be any popup or any warning when the user moves from one page to another page using pager.</div>
<br/>
<div>
How to get the modified values or modified rows with values before the user moves another pager
using the pager of the RaGrid in the codebehind ? Is there any event where we can get the modified rows?</div>
</form>
.cs Content
public partial class RadGrdiForm : System.Web.UI.Page
{
protected void Page_Load(object sender, EventArgs e)
{
}
protected void btnLoadStudent_Click(object sender, EventArgs e)
{
this.rgStudent.DataSource = this.GetStudentData();
this.rgStudent.DataBind();
}
public RadGridProofOfConcept.StudentDS.tblStudentDataTable GetStudentData()
{
RadGridProofOfConcept.StudentDSTableAdapters.tblStudentTableAdapter adapter = new StudentDSTableAdapters.tblStudentTableAdapter();
return adapter.GetData();
}
protected void rgStudent_PageIndexChanged(object sender, Telerik.Web.UI.GridPageChangedEventArgs e)
{
this.rgStudent.CurrentPageIndex = e.NewPageIndex;
this.rgStudent.DataSource = this.GetStudentData();
this.rgStudent.DataBind();
}
}
Is there anyway to attach the sample code which we are working
User Action : User will do a single click and modify the cells and he will go the next page of the RadGrid by click on the pager. User will modify the values in the next page and so on and when user comes back to the previous page the user should see the modified values. There should not be any popup or any warning when the user moves from one page to another page using pager.
How to get the modified values or modified rows with values before the user moves another pager using the pager of the RaGrid in the codebehind ? Is there any event where we can get the modified rows?
.ASPX Content:
<form id="form1" runat="server">
<telerik:RadScriptManager ID="ScriptManager1" runat="server" EnableTheming="True">
<Scripts>
<asp:ScriptReference Assembly="Telerik.Web.UI" Name="Telerik.Web.UI.Common.Core.js">
</asp:ScriptReference>
<asp:ScriptReference Assembly="Telerik.Web.UI" Name="Telerik.Web.UI.Common.jQuery.js">
</asp:ScriptReference>
<asp:ScriptReference Assembly="Telerik.Web.UI" Name="Telerik.Web.UI.Common.jQueryInclude.js">
</asp:ScriptReference>
</Scripts>
</telerik:RadScriptManager>
<div>
<br />
<div>
Click the button to load the Student data</div>
<br />
<telerik:RadButton ID="btnLoadStudent" runat="server" Text="Load Student" OnClick="btnLoadStudent_Click">
</telerik:RadButton>
<br />
<br />
<div style="color: #800080">
The below grid uses BatchEdit Mode: (BatchEditingSettings EditType="Cell" )</div>
<br />
<telerik:RadGrid ID="rgStudent" runat="server" AllowPaging="True" AllowSorting="True" PageSize="4" AutoGenerateColumns="False" GridLines="Both" OnPageIndexChanged="rgStudent_PageIndexChanged" Width="673px">
<MasterTableView EditMode="Batch" DataKeyNames="StudentID" >
<BatchEditingSettings EditType="Cell" />
<RowIndicatorColumn Visible="False">
</RowIndicatorColumn>
<ExpandCollapseColumn Created="True">
</ExpandCollapseColumn>
<Columns>
<telerik:GridTemplateColumn DataField="StudentID" DataType="System.Byte" FilterControlAltText="Filter StudentID column" HeaderText="StudentID" SortExpression="StudentID" UniqueName="StudentID">
<%-- <EditItemTemplate>
<asp:TextBox ID="StudentIDTextBox" runat="server" Text='<%# Bind("StudentID") %>'></asp:TextBox>
</EditItemTemplate>--%>
<ItemTemplate>
<asp:Label ID="StudentIDLabel" runat="server" Text='<%# Eval("StudentID") %>'></asp:Label>
</ItemTemplate>
</telerik:GridTemplateColumn>
<telerik:GridTemplateColumn DataField="StudentName" FilterControlAltText="Filter StudentName column" HeaderText="StudentName" SortExpression="StudentName" UniqueName="StudentName">
<EditItemTemplate>
<asp:TextBox ID="StudentNameTextBox" runat="server" Text='<%# Bind("StudentName") %>' Width="75px"></asp:TextBox>
</EditItemTemplate>
<ItemTemplate>
<asp:Label ID="StudentNameLabel" runat="server" Text='<%# Eval("StudentName") %>'></asp:Label>
</ItemTemplate>
</telerik:GridTemplateColumn>
<telerik:GridTemplateColumn DataField="Mark" DataType="System.Byte" FilterControlAltText="Filter Mark column" HeaderText="Mark" SortExpression="Mark" UniqueName="Mark">
<EditItemTemplate>
<asp:TextBox ID="MarkTextBox" Width="75px" runat="server" Text='<%# Bind("Mark") %>'></asp:TextBox>
</EditItemTemplate>
<ItemTemplate>
<asp:Label ID="MarkLabel" runat="server" Text='<%# Eval("Mark") %>'></asp:Label>
</ItemTemplate>
</telerik:GridTemplateColumn>
<telerik:GridTemplateColumn DataField="Grade" FilterControlAltText="Filter Grade column" HeaderText="Grade" SortExpression="Grade" UniqueName="Grade">
<EditItemTemplate>
<asp:TextBox ID="GradeTextBox" Width="75px" runat="server" Text='<%# Bind("Grade") %>'></asp:TextBox>
</EditItemTemplate>
<ItemTemplate>
<asp:Label ID="GradeLabel" runat="server" Text='<%# Eval("Grade") %>'></asp:Label>
</ItemTemplate>
</telerik:GridTemplateColumn>
<telerik:GridTemplateColumn DataField="Phone" FilterControlAltText="Filter Phone column" HeaderText="Phone" SortExpression="Phone" UniqueName="Phone">
<EditItemTemplate>
<asp:TextBox ID="PhoneTextBox" Width="75px" runat="server" Text='<%# Bind("Phone") %>'></asp:TextBox>
</EditItemTemplate>
<ItemTemplate>
<asp:Label ID="PhoneLabel" runat="server" Text='<%# Eval("Phone") %>'></asp:Label>
</ItemTemplate>
</telerik:GridTemplateColumn>
</Columns>
</MasterTableView>
</telerik:RadGrid>
</div> <br/>
<div>
User Action : User will do a single click and modify the cells and he will go the next page of the RadGrid by click on the pager. User will modify the values in the next page and so on and when user comes back to the previous page the user should see the modified values. There should not be any popup or any warning when the user moves from one page to another page using pager.</div>
<br/>
<div>
How to get the modified values or modified rows with values before the user moves another pager
using the pager of the RaGrid in the codebehind ? Is there any event where we can get the modified rows?</div>
</form>
.cs Content
public partial class RadGrdiForm : System.Web.UI.Page
{
protected void Page_Load(object sender, EventArgs e)
{
}
protected void btnLoadStudent_Click(object sender, EventArgs e)
{
this.rgStudent.DataSource = this.GetStudentData();
this.rgStudent.DataBind();
}
public RadGridProofOfConcept.StudentDS.tblStudentDataTable GetStudentData()
{
RadGridProofOfConcept.StudentDSTableAdapters.tblStudentTableAdapter adapter = new StudentDSTableAdapters.tblStudentTableAdapter();
return adapter.GetData();
}
protected void rgStudent_PageIndexChanged(object sender, Telerik.Web.UI.GridPageChangedEventArgs e)
{
this.rgStudent.CurrentPageIndex = e.NewPageIndex;
this.rgStudent.DataSource = this.GetStudentData();
this.rgStudent.DataBind();
}
}
Is there anyway to attach the sample code which we are working