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

[Solved] Setting the styles of the Headers and Rows

5 Answers 177 Views
Grid
This is a migrated thread and some comments may be shown as answers.
This question is locked. New answers and comments are not allowed.
Reid
Top achievements
Rank 2
Reid asked on 27 Jan 2012, 03:07 PM
Hi all,

Can someone share an example of setting the font properties of the header, footer, rows and selected rows of the grid?

Appreciated,

Reid

5 Answers, 1 is accepted

Sort by
0
Dimo
Telerik team
answered on 30 Jan 2012, 02:40 PM
Hi Reid,

You can use the following CSS selectors to set font styles:

.t-grid .t-header {  } /* header font */

.t-grid .t-header .t-link {  }  /* header text color */

.t-grid .t-footer {  }  /* footer */

.t-grid tr {  }  /* data rows  */

.t-grid tr.t-state-selected {  }  /* selected data rows  */


Kind regards,
Dimo
the Telerik team
If you want to get updates on new releases, tips and tricks and sneak peeks at our product labs directly from the developers working on the Telerik Extensions for ASP.MET MVC, subscribe to their blog feed now
0
Reid
Top achievements
Rank 2
answered on 31 Jan 2012, 01:47 PM
HI Dimo,

Thanks very much for this.  Any examples of applying these selectors? 

Appreciated!

Reid
0
Dimo
Telerik team
answered on 31 Jan 2012, 01:52 PM
Hello Reid,

Did you try the suggested CSS selectors. Did you encounter any issues?

Regards,
Dimo
the Telerik team
If you want to get updates on new releases, tips and tricks and sneak peeks at our product labs directly from the developers working on the Telerik Extensions for ASP.MET MVC, subscribe to their blog feed now
0
Reid
Top achievements
Rank 2
answered on 24 Feb 2012, 01:45 PM
Dimo,

Sorry for not following up sooner.  I am not sure how to apply these selectors.  Can you give me a small example?

Thanks,

Reid
0
Dadv
Top achievements
Rank 1
answered on 24 Feb 2012, 02:14 PM
Hi,

Add an extra CSS file (after the telerik css) and insert something like this :
/* header font */
.t-grid .t-header { color : Red;background-color:#2e2e2e;  } 

 /* header text color */
.t-grid .t-header .t-link {  color : Green;background-color:Red; 


.t-grid .t-footer { ... }  /* footer */

.t-grid tr { ...  }  /* data rows  */

.t-grid tr.t-state-selected { ... }  /* selected data rows  */

and so on..

But be careful , Telerik MVC css use common css class for all the component.

a way to provide specific style for a grid is to embedded it in a div for example :



<div id="myGrid">
<!-- Your grid code -->
</div>


then 

you can replace the css code before by :

/* header font */
#myGrid .t-grid .t-header { color : Red;background-color:#2e2e2e;  } 

 /* header text color */
#myGrid .t-grid .t-header .t-link {  color : Green;background-color:Red; 


#myGrid .t-grid .t-footer { ... }  /* footer */

#myGrid .t-grid tr { ...  }  /* data rows  */

#myGrid .t-grid tr.t-state-selected { ... }  /* selected data rows  */


Look's like what you want ?

ps: don't forget to link your new css file in your header
Tags
Grid
Asked by
Reid
Top achievements
Rank 2
Answers by
Dimo
Telerik team
Reid
Top achievements
Rank 2
Dadv
Top achievements
Rank 1
Share this question
or