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

[Solved] radgrid

3 Answers 117 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Ayesha
Top achievements
Rank 1
Ayesha asked on 25 Jan 2010, 05:34 AM
Hi,
I've radgrid of fixed size. The problem is when my grid comes up filled with 10 items ,I get a scroll bar(which is obvious b'coz I've a small size grid. Now the probem i s when grid gets populated with 10 items, the first 3 gets hideen  and all 4- 10 gets viewed in the grid(the grid can display only 7 items. How do I make the first 7 items to be always visible and remaining 8 , 9 and 10th item to be hidden(ihidden means I can use scrollbar to view them)

3 Answers, 1 is accepted

Sort by
0
Pavlina
Telerik team
answered on 26 Jan 2010, 05:22 PM
Hi Ayesha,

To achieve the desired functionality, you could set the ClientSettings -> Scrolling -> FrozenColumnsCount property of the control, which determines the count of columns (starting from the leftmost column) which will be statically positioned when you drag the horizontal scroll in the grid.

For more information, please review these online resources:
http://demos.telerik.com/aspnet-ajax/grid/examples/generalfeatures/frozencolumns/defaultcs.aspx
http://demos.telerik.com/aspnet-ajax/grid/examples/client/scrolling/defaultcs.aspx

I hope this gets you started properly.

Sincerely yours,
Pavlina
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.
0
Ayesha
Top achievements
Rank 1
answered on 02 Feb 2010, 05:38 AM
Pavlina,

I didn't want the columns. I meant the rows. I always get the 4 - 10 rows visible in my grid. But I need 1- 3 rows to be visible.
How do I do this in my code.
0
Princy
Top achievements
Rank 2
answered on 02 Feb 2010, 08:50 AM
Hi Ayesha,

 To always display the first few rows in the grid when scroling is enabled, you can try out the following javascript code:
aspx:
<telerik:RadGrid ID="RadGrid1" DataSourceID="SqlDataSource1" runat="server"
     <ClientSettings> 
         <ClientEvents OnGridCreated="GridCreated" /> 
         <Scrolling AllowScroll="true" SaveScrollPosition="true"  />         
     </ClientSettings> 
     <MasterTableView DataSourceID="SqlDataSource1"

js:
function GridCreated() 
   { 
      var RadGrid1 = $find("<%= RadGrid1.ClientID %>");   
      //get the main table scrollArea HTML element 
      var scrollArea = RadGrid1.GridDataDiv;                  
      //scroll  to the top 
      scrollArea.scrollTop = 0;         
   } 

Hope this helps..
Princy.
Tags
Grid
Asked by
Ayesha
Top achievements
Rank 1
Answers by
Pavlina
Telerik team
Ayesha
Top achievements
Rank 1
Princy
Top achievements
Rank 2
Share this question
or