GridView Header

  • Thread starter Thread starter Bruno Alexandre
  • Start date Start date
B

Bruno Alexandre

How can I have a header like this:


[ demonstrations ]
[sales] [dns][not qualify]


having one row like colspan="3"
 
I guess, you have use HeaderTemplate attribute to do this.
Let me explain you in case DataList ( or you can modify according the
control you are using, since the approach is same for all

<DataList ..>
<HeaderTemplate>
<Table>
<Tr>
<TD Colspan=3>Demonstrations</TD>
</Tr>
<tr>
<td>sales</td>
<td>dns</td>
<td>not quality</td>
</tr>
</HeaderTemplate>
<ItemTemplate>
<Tr>
<TD Colspan=3><%= Value %></TD>
</Tr>
<tr>
<td><%= Value %></td>
<td><%= Value %></td>
<td><%= Value %></td>
</tr>
</Itemtemplate>
</DataList>

Please note that I am trying to explain you the approach, but not the
actual code.

Do let me know if you have any trouble in implementing this code.
 
well, that would be easy if I was using a DataList :-)

but i'm in a GridView, and GridView does not allow HTML injection like that
:-(

ohh well, I'm still looking 4 something.

--

Bruno Alexandre
"a Portuguese in København, Danmark"



Vadivel Kumar said:
I guess, you have use HeaderTemplate attribute to do this.
Let me explain you in case DataList ( or you can modify according the
control you are using, since the approach is same for all

<DataList ..>
<HeaderTemplate>
<Table>
<Tr>
<TD Colspan=3>Demonstrations</TD>
</Tr>
<tr>
<td>sales</td>
<td>dns</td>
<td>not quality</td>
</tr>
</HeaderTemplate>
<ItemTemplate>
<Tr>
<TD Colspan=3><%= Value %></TD>
</Tr>
<tr>
<td><%= Value %></td>
<td><%= Value %></td>
<td><%= Value %></td>
</tr>
</Itemtemplate>
</DataList>

Please note that I am trying to explain you the approach, but not the
actual code.

Do let me know if you have any trouble in implementing this code.

--
Vadivel Kumar
http://www.vadivelk.net
(e-mail address removed) (remove "online.")

Bruno said:
How can I have a header like this:


[ demonstrations ]
[sales] [dns][not qualify]


having one row like colspan="3"
 
I believe this article should be able to help you.

http://aspnet.4guysfromrolla.com/articles/072603-1.aspx

Bruno Alexandre said:
well, that would be easy if I was using a DataList :-)

but i'm in a GridView, and GridView does not allow HTML injection like that
:-(

ohh well, I'm still looking 4 something.

--

Bruno Alexandre
"a Portuguese in København, Danmark"



Vadivel Kumar said:
I guess, you have use HeaderTemplate attribute to do this.
Let me explain you in case DataList ( or you can modify according the
control you are using, since the approach is same for all

<DataList ..>
<HeaderTemplate>
<Table>
<Tr>
<TD Colspan=3>Demonstrations</TD>
</Tr>
<tr>
<td>sales</td>
<td>dns</td>
<td>not quality</td>
</tr>
</HeaderTemplate>
<ItemTemplate>
<Tr>
<TD Colspan=3><%= Value %></TD>
</Tr>
<tr>
<td><%= Value %></td>
<td><%= Value %></td>
<td><%= Value %></td>
</tr>
</Itemtemplate>
</DataList>

Please note that I am trying to explain you the approach, but not the
actual code.

Do let me know if you have any trouble in implementing this code.

--
Vadivel Kumar
http://www.vadivelk.net
(e-mail address removed) (remove "online.")

Bruno said:
How can I have a header like this:


[ demonstrations ]
[sales] [dns][not qualify]


having one row like colspan="3"
 
Hi Mike

4GuysFromRolla and GridViewGuy is my main websites, and I couldn't find this
articles :-/
(I personally hate the search function inside 4gfr, I always use Google with
the site:www.4.... )

but thank you very much...

the article describes how to insert rows and do what I need in rowItens
wicth is great, now I can search and test it do do that in the header :-)

Thank u once again

--

Bruno Alexandre
"a Portuguese in København, Danmark"



Mike Collins said:
I believe this article should be able to help you.

http://aspnet.4guysfromrolla.com/articles/072603-1.aspx

Bruno Alexandre said:
well, that would be easy if I was using a DataList :-)

but i'm in a GridView, and GridView does not allow HTML injection like
that
:-(

ohh well, I'm still looking 4 something.

--

Bruno Alexandre
"a Portuguese in København, Danmark"



Vadivel Kumar said:
I guess, you have use HeaderTemplate attribute to do this.
Let me explain you in case DataList ( or you can modify according the
control you are using, since the approach is same for all

<DataList ..>
<HeaderTemplate>
<Table>
<Tr>
<TD Colspan=3>Demonstrations</TD>
</Tr>
<tr>
<td>sales</td>
<td>dns</td>
<td>not quality</td>
</tr>
</HeaderTemplate>
<ItemTemplate>
<Tr>
<TD Colspan=3><%= Value %></TD>
</Tr>
<tr>
<td><%= Value %></td>
<td><%= Value %></td>
<td><%= Value %></td>
</tr>
</Itemtemplate>
</DataList>

Please note that I am trying to explain you the approach, but not the
actual code.

Do let me know if you have any trouble in implementing this code.

--
Vadivel Kumar
http://www.vadivelk.net
(e-mail address removed) (remove "online.")

Bruno Alexandre wrote:
How can I have a header like this:


[ demonstrations ]
[sales] [dns][not qualify]


having one row like colspan="3"
 
Back
Top