In one of my user control, I've a radgrid with paging turned on. when i travel to the 3rd or 4th page or any page, then open up my ser control, my last page which i was working on is appearing as the current page. But I want the first page to alwasy come whenever I open up my user control and bind the grid.
Pls help me with code samples.
To be more clear, I do not have a "Add new record " button. It's my own button"Add" which opens up a user control with a grid(with paging on).
When I'm in my user control, I go to the 3rd page and click cancel and exit from the user control and if I click "ADD" button from my aspx ,I open up the user control. but the grid is in page 3 and not in page 1. How do I make the grid to be in page 1 always when I open up that user control. Pls do help:
7 Answers, 1 is accepted
On clicking the AddNewRecord button, the grid moves to the last page by default. If this the case you are refering to, then you can set the InsertItemPageIndexAction property of the MasterTableView, inorder to retain the current page.
aspx:
| <telerik:RadGrid ID="RadGrid1" DataSourceID="SqlDataSource1" runat="server"> |
| <MasterTableView InsertItemPageIndexAction="ShowItemOnCurrentPage" CommandItemDisplay="Top" DataSourceID="SqlDataSource1"> |
Thanks
Shinu.
I tried with MasterTableView InsertItemPageIndexAction="ShowItemOnCurrentPage" in my grid . But this always takes to the page where I left if I click the"Add" butto.
How do I always get the first page in my grid when I clcik the add button.
Pls do help me with code samples.
To display the insert form on the first page always, you can set the InsertItemPageIndexAction property of the MasterTableView to ShowItemOnFirstPage. Refer to the following document which would provide you with insights on customizing the Insert form display position in the grid.
aspx:
| <telerik:RadGrid ID="RadGrid1" DataSourceID="SqlDataSource1" runat="server"> |
| <MasterTableView InsertItemPageIndexAction="ShowItemOnFirstPage" CommandItemDisplay="Top" DataSourceID="SqlDataSource1"> |
Thanks
Princy.
I tried MasterTableView InsertItemPageIndexAction="ShowItemOnCurrentPage" (and even showitemonfirstpage) but nothing seems to be of help.
Pls help me:
When I clcik a button named "Open Items" , I open up my user control which has a radgrid with paging enabled. Now when I go to 3rd page and again click my button"open items" ,I get the grid which is still in the 3rd page. But I need my grid to be brought with first page as my default? how do I do this? hope I made my question clear.
This si my gridsettings
<telerik:RadGrid ID="m_radGrid" runat="server"
CellPadding="0"
AllowMultiRowSelection="True"
GroupingEnabled="False"
HorizontalAlign="Left"
OnNeedDataSource="m_radGrid_NeedDataSource"
OnItemCommand = "m_radGrid_ItemCommand"
onselectedindexchanged="m_radGrid_SelectedIndexChanged">
<MasterTableView AllowPaging="true"
AllowSorting="true"
AllowFilteringByColumn="true"
PagerStyle-Mode="NextPrevAndNumeric" PageSize="10">
<Columns>
<telerik:GridClientSelectColumn Reorderable="False" UniqueName="ClientSelectColumn">
<HeaderStyle Width="30px">
</HeaderStyle>
</telerik:GridClientSelectColumn>
</Columns>
</MasterTableView>
<GroupingSettings CaseSensitive="false" />
<ClientSettings EnablePostBackOnRowClick ="true" >
<Scrolling AllowScroll="True"
UseStaticHeaders="True" />
<Selecting AllowRowSelect="true" EnableDragToSelectRows ="true" />
<Resizing AllowColumnResize="true"
ClipCellContentOnResize="true"
EnableRealTimeResize="true"
ResizeGridOnColumnResize="false" />
</ClientSettings>
</telerik:RadGrid>
Thanks for your reply. I do not use a RAdwindow. I have a multiview. So, when they click the open button(yes, it's outside the grid), I set the activeview to appropriate view. That view has a user control which loads the grid and binds it. But it always doesn't give me the first page as default page when I load the grid . It restores the page which I was in last time and brings that page of the grid first when I clcik the open button which is outside the grid.
Attached is a small sample that demonstrates your scenario.
I hope it helps.
All the best,
Tsvetoslav
the Telerik team
Instantly find answers to your questions on the new Telerik Support Portal.
Watch a video on how to optimize your support resource searches and check out more tips on the blogs.