GridView and master

  • Thread starter Thread starter Hari
  • Start date Start date
H

Hari

Hi All,

Is there any way to write a CSS kinda header or table definition in
Master Page, so that all GridViews in child pages have the same looks?

Regards,
Prakash.
 
Is there any way to write a CSS kinda header or table definition in
Master Page, so that all GridViews in child pages have the same looks?

1) Create a stylesheet
2) Add the various styles you want for your GridViews
3) Add a reference to the stylesheet in the header section of your
MasterPage

What problem are you having...?
 
You should use CSS classes for this. GridViews are ASP.net controls that
render out whatever HTML is aplicable to the relevent browser. You cannot
set a style in a style sheet that will apply to all GridViews the same say
you can for HTML elements such as <table> <body> etc. GridViews have a
CSSClass property. Set up a css class in your style sheet then set the
cssclass property of the GridView to refer to it.
 
Hi Rae, Clickon,

I know this usual way. I do like this in HTML. I'm a PHP programmer
and at last turned to ASP.NET. I just started learning. I thought it
would be nice, If I visually design sample table and its styles in
Master Page and I just make style reference in the child pages.

Suppose I have GridView in Two Pages, like Default format is
separately available in that controls. If have a sample GridView in
master page, and it has a style which reflects in all gridviews using
that master page. Anyway your solution works fine.

Thank you.

Regards,
Hari.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top