Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > ASP .Net > ASP .Net Datagrid Control > Is it possible to create a custom header/footer - not with column names but with html

Reply
Thread Tools

Is it possible to create a custom header/footer - not with column names but with html

 
 
mortb
Guest
Posts: n/a
 
      05-12-2004
I want to know if it is possible to create my own header and footer which contains
arbitrary text/html items in a datagrid .

Look at the included picture for example.
Another example:

+----------------------------+
| Header text |
+---------+---------+--------+
| Item1.1 | Item1.2 | Item1.3|
+---------+---------+--------+
| Item2.1 | Item2.2 | Item2.3|
+---------+---------+--------+
| <input field><button> |
+---------+---------+--------+

How do I do this?
Any help would be deeply appreciated!

chers,
mortb
 
Reply With Quote
 
 
 
 
Sal
Guest
Posts: n/a
 
      05-12-2004
Mortb,
See my post "ItemCommand not firing w/ a control in ItemTemplate column". There I indicate a problem but I include code that does what ur looking to do. That code creates and adds the custom header row to the datagrid.
It works but I'm not sure if that is the best way to do it. As I say in the post I'm dealing with a problem with that and an itemtemplate in the grid. It'll get you started though.
HTH,
Sal
"mortb" <> wrote in message news:%...
I want to know if it is possible to create my own header and footer which contains
arbitrary text/html items in a datagrid .

Look at the included picture for example.
Another example:

+----------------------------+
| Header text |
+---------+---------+--------+
| Item1.1 | Item1.2 | Item1.3|
+---------+---------+--------+
| Item2.1 | Item2.2 | Item2.3|
+---------+---------+--------+
| <input field><button> |
+---------+---------+--------+

How do I do this?
Any help would be deeply appreciated!

chers,
mortb
 
Reply With Quote
 
 
 
 
Leonardo Rodríguez
Guest
Posts: n/a
 
      05-12-2004
Of course you can.
This link can help you:

http://msdn.microsoft.com/library/de...webcontrol.asp


Regards,

--

Leonardo C. Rodríguez
Email at:
Location : Bs.As., Argentina



"mortb" <> wrote in message news:%...
I want to know if it is possible to create my own header and footer which contains
arbitrary text/html items in a datagrid .

Look at the included picture for example.
Another example:

+----------------------------+
| Header text |
+---------+---------+--------+
| Item1.1 | Item1.2 | Item1.3|
+---------+---------+--------+
| Item2.1 | Item2.2 | Item2.3|
+---------+---------+--------+
| <input field><button> |
+---------+---------+--------+

How do I do this?
Any help would be deeply appreciated!

chers,
mortb
 
Reply With Quote
 
mortb
Guest
Posts: n/a
 
      05-13-2004
Thank you for your help,
I would like to know though if it is possible to make the header span several columns. (Like colspan in a regular table).

cheers,
mortb
"Leonardo Rodríguez" <> wrote in message news:...
Of course you can.
This link can help you:

http://msdn.microsoft.com/library/de...webcontrol.asp


Regards,

--

Leonardo C. Rodríguez
Email at:
Location : Bs.As., Argentina



"mortb" <> wrote in message news:%...
I want to know if it is possible to create my own header and footer which contains
arbitrary text/html items in a datagrid .

Look at the included picture for example.
Another example:

+----------------------------+
| Header text |
+---------+---------+--------+
| Item1.1 | Item1.2 | Item1.3|
+---------+---------+--------+
| Item2.1 | Item2.2 | Item2.3|
+---------+---------+--------+
| <input field><button> |
+---------+---------+--------+

How do I do this?
Any help would be deeply appreciated!

chers,
mortb
 
Reply With Quote
 
David Jessee
Guest
Posts: n/a
 
      05-13-2004
I don't know if its directly possible, but I can tell you how I do it. I turn off the header and then place the grid inside of a table.

<table cellpadding="0" cellspacing="0" border="0">
<tr>
<td>The Pseudo-Header Text</td>
</tr>
<tr>
<td>
<asp:datagrid .........>
</asp:datagrid>
</td>
</tr>
</table>



"mortb" <> wrote in message news:%...
I want to know if it is possible to create my own header and footer which contains
arbitrary text/html items in a datagrid .

Look at the included picture for example.
Another example:

+----------------------------+
| Header text |
+---------+---------+--------+
| Item1.1 | Item1.2 | Item1.3|
+---------+---------+--------+
| Item2.1 | Item2.2 | Item2.3|
+---------+---------+--------+
| <input field><button> |
+---------+---------+--------+

How do I do this?
Any help would be deeply appreciated!

chers,
mortb
 
Reply With Quote
 
mortb
Guest
Posts: n/a
 
      05-24-2004
I wanted an exact apperance where the header was as big as the datagrid an aligned pixel to pixel.

What I finally did was:

<table>
<tr>
<td>
<table cellpadding="0" cellspacing="0" border="0" witdh="100%">
<tr>
<td>Header</td>
</tr>
</table>
<asp:datagrid id="myGrid" runat="server" witdh="100%" ShowHeader="False" />
<table cellpadding="0" cellspacing="0" border="0" witdh="100%">
<tr>
<td><asp:textbox id="myTxt" runat="server" /><asp:button id="myBtn" runat="server" /></td>
</tr>
</table>
</td>
</tr>
</table>

I could have solved this programatically by adding my custom header through code but I believe that design and code should be a separate things.
I guess I could've found the behavior I wanted in a third party grid, but I think it's hard to know what grid to get.
It would have been easier if the colspan attribute was implemented from the start in microsoft's grid.

I guess I'll have to write my own grid some day.

cheers,
mortb

"David Jessee" <> wrote in message news:%23%...
I don't know if its directly possible, but I can tell you how I do it. I turn off the header and then place the grid inside of a table.

<table cellpadding="0" cellspacing="0" border="0">
<tr>
<td>The Pseudo-Header Text</td>
</tr>
<tr>
<td>
<asp:datagrid .........>
</asp:datagrid>
</td>
</tr>
</table>

 
Reply With Quote
 
 
 
Reply

Thread Tools

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
is it possible to possible to create an iterator from a callback interace? aninnymouse@gmail.com C Programming 4 02-21-2006 02:10 PM
Create custom server variable, it's possible? joun ASP .Net 15 11-24-2004 07:22 PM
Activa or not activate a button column depending if another data column has data or not carlos perez ASP .Net 0 06-08-2004 02:16 PM
Is it possible to get all the column names in a database table? Showjumper ASP .Net 1 02-21-2004 05:29 PM
Is it possible to create a custom web control like this? billym ASP .Net Web Controls 1 09-08-2003 04:24 AM



Advertisments
 



1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57