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

Additional rows not styled when changing page size

4 Answers 80 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Martin
Top achievements
Rank 1
Martin asked on 14 May 2009, 08:46 AM

I use GridColumn Collection editor to set CSS classes because I need to style columns differently (just right/left alignment of text actually).

If default pagesize is 10 and I use the page control to select 20 or 50 then rows 11-20 / 11-50 are not styled.
If default pagesize is 20 and I select 50 then 21-50 are not styled.

If I do not set CSS classes in GridColumn Collection editor and instead set a css class in RadGrid properties then all additional rows are styled but then all columns are of course styled using same class.

Has anyone encountered this problem? What can be done to fix it?

4 Answers, 1 is accepted

Sort by
0
Accepted
Bruno
Top achievements
Rank 2
answered on 18 May 2009, 10:17 AM
I'm guessing  that you are using client-side databinding, correct?
If this the case you may use RowDataBound clients-side event to apply styles to cells as shown in this example http://demos.telerik.com/aspnet-ajax/grid/examples/client/databinding/defaultcs.aspx

--Bruno
0
Martin
Top achievements
Rank 1
answered on 19 May 2009, 12:17 PM

I do this (It's client side but I'm not sure it is client-side databinding,):

 
<ClientSettings EnableRowHoverStyle="True"
        <Selecting AllowRowSelect="true"/> 
        <DataBinding Location="PropertyResultList.asmx" 
        SelectMethod="GetPropertyInformationForGridWithCount" 
        SelectCountMethod="GetPropertyCount" 
        StartRowIndexParameterName="startIndex"                     
        MaximumRowsParameterName="rowCount">       
        </DataBinding> 
        <ClientEvents OnCommand="RadGrid1_Command" 
            onrowclick="PropertyList_OnRowClick" 
            OnRowSelected="PropertyList_OnRowSelected"/> 
        <ClientMessages PagerTooltipFormatString="Side&nbsp;&lt;strong&gt;{0}&lt;/strong&gt;&nbsp;af&nbsp;&lt;strong&gt;{1}&lt;/strong&gt;" /> 
    </ClientSettings> 

0
Sebastian
Telerik team
answered on 22 May 2009, 12:09 PM
Hello Martin,

Indeed you are using declarative client-side binding through web service as the DataBinding tag of the grid indicates. Therefore consider the solution suggestion by Bruno to solve the issue you are currently facing.

Best regards,
Sebastian
the Telerik team

Instantly find answers to your questions on the new Telerik Support Portal.
Check out the tips for optimizing your support resource searches.
0
Martin
Top achievements
Rank 1
answered on 26 May 2009, 12:20 PM
Ok that does the trick but it is a bit cumbersome. I suppose there is some reason that it is that way. Thanks a lot for your replies.
Tags
Grid
Asked by
Martin
Top achievements
Rank 1
Answers by
Bruno
Top achievements
Rank 2
Martin
Top achievements
Rank 1
Sebastian
Telerik team
Share this question
or