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

[Solved] radgrid

7 Answers 126 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Ayesha
Top achievements
Rank 1
Ayesha asked on 04 Dec 2009, 04:15 AM
Hi,

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

Sort by
0
Shinu
Top achievements
Rank 2
answered on 04 Dec 2009, 07:14 AM
Hello Zaheka,

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.
0
Ayesha
Top achievements
Rank 1
answered on 18 Dec 2009, 04:43 PM
Hi,

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.
0
Princy
Top achievements
Rank 2
answered on 21 Dec 2009, 05:44 AM
Hello Ayesha,

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.
0
Ayesha
Top achievements
Rank 1
answered on 24 Dec 2009, 05:23 AM
Hi,

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>

 


0
Shinu
Top achievements
Rank 2
answered on 29 Dec 2009, 02:47 PM
Hello Ayesha,

I suppose you have the Open Items button placed outside your grid, on clicking which opens a RadWindow popup with UserControl loaded in it. If thats the case, then you can try setting the DestroyOnClose property of the RadWindow to true, inorder to reload the grid when opening the window, everytime.

 If this is not the case, please explain your scenario in detail.
-Shinu.
0
Ayesha
Top achievements
Rank 1
answered on 29 Dec 2009, 02:58 PM
Hi shinu,

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.
0
Tsvetoslav
Telerik team
answered on 29 Dec 2009, 04:21 PM
Hi Ayesha,

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.
Tags
Grid
Asked by
Ayesha
Top achievements
Rank 1
Answers by
Shinu
Top achievements
Rank 2
Ayesha
Top achievements
Rank 1
Princy
Top achievements
Rank 2
Tsvetoslav
Telerik team
Share this question
or