Hi Experts
I'm new in Radgrid and having RadGrid Virtualization, and used manual binding(NeedDataSource) and set virtual count there. The problem I'm facing when I editing the items in separate command button to show the all relevant items in RadWindow and update there, after ajaxRequest("Rebind"), Radgrid lost PageIndex and Current Row Number
Please suggest how to set the PageIndex and Current row after rebind. below is the details in data binding
And following is the aspx markup
following is the Javascript for edit the items
I'm new in Radgrid and having RadGrid Virtualization, and used manual binding(NeedDataSource) and set virtual count there. The problem I'm facing when I editing the items in separate command button to show the all relevant items in RadWindow and update there, after ajaxRequest("Rebind"), Radgrid lost PageIndex and Current Row Number
Please suggest how to set the PageIndex and Current row after rebind. below is the details in data binding
protected void RadGrd1_NeedDataSource(object sender, Telerik.Web.UI.GridNeedDataSourceEventArgs e)
{
RadGrd1.DataSource = GridRecordSource;
RadGrd1.MasterTableView.VirtualItemCount = ((DataTable)Application["_GridRowSource"]).Rows.Count;
}
private DataTable GridRecordSource
{
get {
object RowSource= Application["_GridRowSource"];
if (RowSource!=null)
{
return RowSource as DataTable;
}
else
{
GridRowSource=UserBL.SelectAll("CustomerDetail");
Application["_GridRowSource"]=GridRowSource;
// RadGrd1.CurrentPageIndex * RadGrd1.PageSize + " AND " + ((RadGrd1.CurrentPageIndex + 1) * RadGrd1.PageSize));
return GridRowSource;
}
}
}
And following is the aspx markup
<
telerik:RadGrid
runat
=
"server"
ID
=
"RadGrd1"
AutoGenerateColumns
=
"False"
GridLines
=
"Horizontal"
ShowStatusBar
=
"true"
OnNeedDataSource
=
"RadGrd1_NeedDataSource"
OnDataBound
=
"RadGrid1_DataBound"
Skin
=
"Outlook"
Width
=
"143px"
>
<
MasterTableView
Width
=
"99%"
AllowPaging
=
"true"
PageSize
=
"50"
AllowSorting
=
"false"
BorderStyle
=
"None"
ClientDataKeyNames
=
"RecordID"
TableLayout
=
"Fixed"
NoMasterRecordsText
=
"Records not found in Customerdetail tables"
>
<
Columns
>
<
telerik:GridBoundColumn
DataField
=
"FirstName"
HeaderText
=
"Customer Name"
UniqueName
=
"FirstName"
HeaderStyle-Height
=
"122px"
>
</
telerik:GridBoundColumn
>
<
telerik:GridBoundColumn
DataField
=
"LastName"
HeaderText
=
""
UniqueName
=
"LastName"
Display
=
"false"
>
</
telerik:GridBoundColumn
>
<
telerik:GridBoundColumn
DataField
=
"Phonenumber"
HeaderText
=
""
UniqueName
=
"Phonenumber"
Display
=
"false"
>
</
telerik:GridBoundColumn
>
<
telerik:GridBoundColumn
DataField
=
"Email"
HeaderText
=
""
UniqueName
=
"Email"
Display
=
"false"
>
</
telerik:GridBoundColumn
>
<
telerik:GridBoundColumn
DataField
=
"dob"
HeaderText
=
""
UniqueName
=
"dob"
DataType
=
"System.DateTime"
Display
=
"false"
>
</
telerik:GridBoundColumn
>
<
telerik:GridBoundColumn
DataField
=
"Country"
HeaderText
=
""
UniqueName
=
"Country"
Display
=
"false"
>
</
telerik:GridBoundColumn
>
<
telerik:GridBoundColumn
DataField
=
"State"
HeaderText
=
""
UniqueName
=
"State"
Display
=
"false"
>
</
telerik:GridBoundColumn
>
</
Columns
>
<
CommandItemTemplate
>
</
CommandItemTemplate
>
</
MasterTableView
>
<
PagerStyle
Visible
=
"false"
/>
<
ClientSettings
ReorderColumnsOnClient
=
"true"
AllowColumnsReorder
=
"true"
ColumnsReorderMethod
=
"Reorder"
>
<
ClientEvents
OnRowSelecting
=
"PushToDock"
/>
<
Virtualization
InitiallyCachedItemsCount
=
"50"
RetrievedItemsPerRequest
=
"50"
ItemsPerView
=
"50"
EnableVirtualization
=
"true"
LoadingPanelID
=
"RadAjaxLoadingPanel1"
/>
<
Selecting
AllowRowSelect
=
"true"
/>
<
Scrolling
ScrollHeight
=
"200px"
AllowScroll
=
"True"
EnableVirtualScrollPaging
=
"true"
UseStaticHeaders
=
"true"
/>
<
Resizing
AllowColumnResize
=
"true"
/>
</
ClientSettings
>
<
SelectedItemStyle
Font-Bold
=
"true"
ForeColor
=
"#000099"
/>
</
telerik:RadGrid
>
function ShowEditForm(tcRecordID, rowIndex) {
tcRecordID = $('input[id$=Recno]').val();
$('input[id$=Recno]').val(tcRecordID); // store the RecordID into asp hidden field so that recordposition will be thre
var openwindow = window.radopen("EditAddRecord.aspx?RecordID=" + tcRecordID, "UserListDialog");
return false;
}