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

radgrid css

3 Answers 128 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Ron
Top achievements
Rank 1
Ron asked on 13 Sep 2011, 03:24 PM
Hi,

Can you tell me how to change rad grid row back color, height and selected item or focused row in css?

Thanks,

3 Answers, 1 is accepted

Sort by
0
Princy
Top achievements
Rank 2
answered on 13 Sep 2011, 04:01 PM
Hello Ron,

One suggestion is to override the default CSS like below.
CSS:
.RadGrid_Sunset .rgRow td
        {
            height: 80px !important;
            background-color: Yellow !important;
        }
.RadGrid_Sunset .rgAltRow td
        {
            height: 80px !important;
            background-color: Black !important;
        }

Another approach is to set the style in aspx itself.
aspx:
<AlternatingItemStyle BackColor="Red" Height="60px" />
<ItemStyle BackColor="Yellow" Height="20px" />

Thanks,
Princy.
0
Ron
Top achievements
Rank 1
answered on 13 Sep 2011, 04:53 PM
I figure I'd do it in css instead of within the grid because I will have about 8 grids across this site using the same scheme. I thought it would be easier.  ".RadGrid_Sunset" is that the name of a skin and is that exactly what i would enter into css script?
0
Princy
Top achievements
Rank 2
answered on 21 Sep 2011, 11:23 AM
Hello Ron,

The Skin applied to RadGrid is 'Sunset'. Once you set the above css in page it will apply the css style to all Radgrid in that page(which has Skin 'Sunset'). Hope this information helps.

ASPX:
<telerik:RadGrid ID="RadGrid1" runat="server" AutoGenerateColumns="true" DataSourceID="SqlDataSource1"
        Skin="Sunset">
        <MasterTableView>
            <Columns>
                            
            </Columns>
        </MasterTableView>
 </telerik:RadGrid>
      <telerik:RadGrid ID="RadGrid2" runat="server" AutoGenerateColumns="true" DataSourceID="SqlDataSource1"
         Skin="Sunset">
        <MasterTableView >
            <Columns>
              
            </Columns>
        </MasterTableView>
     </telerik:RadGrid>

CSS:-
<style type="text/css">
    .RadGrid_Sunset .rgRow td
    {
        background-color: Yellow !important;
    }
   
</style>

Thanks,
Princy.
Tags
Grid
Asked by
Ron
Top achievements
Rank 1
Answers by
Princy
Top achievements
Rank 2
Ron
Top achievements
Rank 1
Share this question
or