PC Review


Reply
Thread Tools Rate Thread

Clone a gridview's template styles

 
 
deostroll
Guest
Posts: n/a
 
      29th Oct 2009
I was trying to email the gridview's content, but while trying to render the
control's html using the textwriter I got an error. The workaround I found to
this was instantiate another (2nd) gridview, and bind that separately. I
don't need to start explicit database connections to fetch the data; I can
use the 1st gridview as my source (iterating thru its rows and populating a
datatable)...Now is there a possibility where I can clone its look and feel
so that when my 2nd gridview renders it renders will the styles I see off my
web page?

--deostroll
 
Reply With Quote
 
 
 
 
Alexey Smirnov
Guest
Posts: n/a
 
      29th Oct 2009
On Oct 29, 9:26*am, deostroll <deostr...@discussions.microsoft.com>
wrote:
> I was trying to email the gridview's content, but while trying to render the
> control's html using the textwriter I got an error. The workaround I found to
> this was instantiate another (2nd) gridview, and bind that separately. I
> don't need to start explicit database connections to fetch the data; I can
> use the 1st gridview as my source (iterating thru its rows and populatinga
> datatable)...Now is there a possibility where I can clone its look and feel
> so that when my 2nd gridview renders it renders will the styles I see offmy
> web page?
>
> --deostroll


I think the easiest way is to use css and apply the same cssclass to
both grids

GridView2.CssClass = GridView1.CssClass

otherwise you would probably need to set each property

GridView2.GridLines = GridView1.GridLines
GridView2.BorderStyle = GridView1.GridLines
GridView2.BorderColor = GridView1.BorderStyle
 
Reply With Quote
 
deostroll
Guest
Posts: n/a
 
      29th Oct 2009
> GridView2.CssClass = GridView1.CssClass

We don't assign CssClass to anything initially. Moreover for GridView1 we do
not manually code for looks. We use the Auto Format feature from the
gridview's design-time menu...
 
Reply With Quote
 
 
 
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Template Styles Barbara Nie Microsoft Powerpoint 1 4th Sep 2008 12:02 AM
GridView CSS styles Goofy Microsoft ASP .NET 6 20th Dec 2006 12:05 PM
2.0: Gridview row styles applied to TR, does not work HoustonFreeways Microsoft ASP .NET 1 17th Feb 2006 04:14 PM
Clone styles (and content) cellwise across pages Gnarlodious Microsoft Excel Discussion 1 10th Jan 2005 04:05 PM
How to get new styles into a template Keith Brickey Microsoft Word Document Management 1 14th Aug 2003 08:33 PM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 12:27 PM.