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

Scrolling and Paging

1 Answer 55 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Dip
Top achievements
Rank 1
Dip asked on 02 Jan 2009, 07:29 PM
I have a small problem with scrolling..Let me explain the requirement that I have with me..If the role return to the Grid is more that 100 the paging else scrolling...
Ok it straight Forward...

My Aspx page...

 

<telerik:RadGrid ID="AllianceGrid" runat="server" EnableEmbeddedSkins="false" Skin="Shepherd" AutoGenerateColumns="false" OnItemCommand="AllianceGrid_RowClick" Width="100%" Height="500px">

 

 

<MasterTableView DataKeyNames="AllianceID,AllianceCode">

 

 

 

<Columns>

 

 

<telerik:GridBoundColumn DataField="AllianceID" HeaderText="Alliance ID"

 

 

UniqueName="AllianceID">

 

 

</telerik:GridBoundColumn>

 

 

<telerik:GridBoundColumn DataField="AllianceCode" HeaderText="Alliance ID"

 

 

UniqueName="AllianceCode">

 

 

</telerik:GridBoundColumn>

 

 

<telerik:GridBoundColumn DataField="AllianceName" HeaderText="Alliance Name"

 

 

UniqueName="AllianceName">

 

 

</telerik:GridBoundColumn>

 

 

<telerik:GridBoundColumn DataField="EffectiveDate" HeaderText="Effective Date"

 

 

UniqueName="EffectiveDate">

 

 

</telerik:GridBoundColumn>

 

 

<telerik:GridBoundColumn DataField="DiscontinueDate" HeaderText="Discontinue Date"

 

 

UniqueName="AllianceName">

 

 

</telerik:GridBoundColumn>

 

 

<telerik:GridBoundColumn DataField="AllianceDescription" HeaderText="Comments"

 

 

UniqueName="AllianceDescription">

 

 

</telerik:GridBoundColumn>

 

 

</Columns>

 

 

</MasterTableView>

 

 

<HeaderStyle Width="16%" />

 

 

<ClientSettings EnablePostBackOnRowClick="true" EnableRowHoverStyle="true">

 

 

<Selecting AllowRowSelect="True" />

 

 

</ClientSettings>

 

 

</telerik:RadGrid>

My code behind..

 

 

protected void Page_Load(object sender, EventArgs e)

 

{

 collection<object> objCol=new collection<object>();
objCol=Admin.GetData(;
if(objCol.Count>101)
{

    AllianceGrid.AllowPaging =

true;

 

    AllianceGrid.PageSize = 10;

    AllianceGrid.PagerStyle.Mode =

GridPagerMode.NextPrevAndNumeric;
}
else
{

   AllianceGrid.HeaderStyle.Width =

Unit.Percentage(16.00);

 

    AllianceGrid.ClientSettings.Scrolling.AllowScroll =

true;

 

    AllianceGrid.ClientSettings.Scrolling.EnableVirtualScrollPaging =

true;

 

    AllianceGrid.ClientSettings.Scrolling.UseStaticHeaders =

true;

 

    AllianceGrid.ClientSettings.Scrolling.SaveScrollPosition =

true;
}
}

this is my almost exact code..Now it works pefect , but only one problem..When it displays the scroll bar , for few seconds all the column get smush up in left hand corner ,but after a second every thing gets normal..Even after defining the HeaderStyle  width in .apsx and in .cs , I still have the same problem.What am I suppose to do?Is there any property that I din't turn on?

Thanks,
DIP

 

1 Answer, 1 is accepted

Sort by
0
Shinu
Top achievements
Rank 2
answered on 06 Jan 2009, 10:59 AM
Hi Dip,

One suggestion will be to set the Width attribute in pixels rather than setting it in percentage and see if it helps. Also set the TableLayout to Fixed.

Shinu
Tags
Grid
Asked by
Dip
Top achievements
Rank 1
Answers by
Shinu
Top achievements
Rank 2
Share this question
or