Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > ASP .Net > How to make a datagrid column a row

Reply
Thread Tools

How to make a datagrid column a row

 
 
Ken B
Guest
Posts: n/a
 
      09-25-2007
How can I make a datagrid column into a single row that spans all the
other columns?
In this case I have a comment field that I want to make as wide as the
table but I cannot figure out how to tell asp.net datagrid that I want
a new row.

I am using visual studio 2005,

Thanks to anybody who has tried this and has a solution

KB

 
Reply With Quote
 
 
 
 
Eliyahu Goldin
Guest
Posts: n/a
 
      09-25-2007
You may look at using a repeater with 2 rows in the itemtemplate. Something
like this:

<asp:repeater>
<headertemplate>
<table>
</headertemplate>
<itemtemplate>
<tr runat="server" id="trNormal">
<td>Databind expression for column 1</td>
<td>Databind expression for column 2</td>
<td>Databind expression for column 3</td>
</tr>
<tr runat="server" id="trComment">
<td columnspan=3>Databind expression for comment</td>
</tr>
</itemtemplate>
</asp:repeater>
<footertemplate>
</table>
</footertemplate>

and handle ItemDataBound event to hide trNormal or trComment as needed.
--
Eliyahu Goldin,
Software Developer
Microsoft MVP [ASP.NET]
http://msmvps.com/blogs/egoldin
http://usableasp.net


"Ken B" <> wrote in message
news: ups.com...
> How can I make a datagrid column into a single row that spans all the
> other columns?
> In this case I have a comment field that I want to make as wide as the
> table but I cannot figure out how to tell asp.net datagrid that I want
> a new row.
>
> I am using visual studio 2005,
>
> Thanks to anybody who has tried this and has a solution
>
> KB
>



 
Reply With Quote
 
 
 
 
Michael Nemtsev, MVP
Guest
Posts: n/a
 
      09-25-2007
Hello Ken,

U need to handle RowDataBound event making changes to your rows there

see sample there http://dotnetjunkies.com/WebLog/josh...23/141038.aspx

---
WBR,
Michael Nemtsev [.NET/C# MVP] :: blog: http://spaces.live.com/laflour

"The greatest danger for most of us is not that our aim is too high and we
miss it, but that it is too low and we reach it" (c) Michelangelo


KB> How can I make a datagrid column into a single row that spans all
KB> the
KB> other columns?
KB> In this case I have a comment field that I want to make as wide as
KB> the
KB> table but I cannot figure out how to tell asp.net datagrid that I
KB> want
KB> a new row.
KB> I am using visual studio 2005,
KB>
KB> Thanks to anybody who has tried this and has a solution
KB>
KB> KB
KB>


 
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
Re: How include a large array? Edward A. Falk C Programming 1 04-04-2013 08:07 PM
bind a dropdown in a column in a datagrid based on the dropdown value selected in another column of the datagrid. vishnu ASP .Net 1 03-25-2006 01:24 PM
ok I can do a totals row but how about a percentage row after each data row D ASP .Net Datagrid Control 0 05-23-2005 04:10 PM
Make a DataGrid row editable after user selects the row Luis Esteban Valencia ASP .Net 0 01-12-2005 05:59 PM
how do i access a dropdownlists selected value in a datagrid edititemtemplate column from the selectedindexchanged event of another dropdownlist in a datagrid edititemtemplate column Dave M ASP .Net Datagrid Control 0 12-14-2004 11:53 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