Vertical DataGrid

R

Ryan

Is there any way to make a datagrid display its data
vertically? I have a table with about 40 columns which I
would like to put in a grid of some sort for editing, but
in the standard datagrid, it stretches way beyond the
screen. I'd like to display the data, one record at a time
with the database columns listed vertically on the screen.
Is there an easy way to do this? A DataList perhaps?

thanks
 
N

N

Either a DataList or DataGrid would do..

Personally I prefer datagrids myself.
In DataGrid, then use the TemplateColumn... just specify the proper bindings
in the ItemTemplate & EditTemplate sections of the grid.
A quick example would be as follows...

<asp:datagrid id=dgSearchResult runat="server">
<Columns>
<asp:TemplateColumn>
<ItemTemplate>
CustomerNum: <b><%# DataBinder.Eval(Container.DataItem,
"customerNum")%>)</b><br>
</ItemTemplate>

<EditItemTemplate>
<asp:TextBox runat="server" Text='<%#
DataBinder.Eval(Container.DataItem, "customerNum") %>'>
</asp:TextBox>
</EditItemTemplate>
</asp:TemplateColumn>
</Columns>
</asp:datagrid>

So, you could have a nested table in the ItemTemplate & EditItemTemplate
sections...

Regards,
Noel Hoo
(e-mail address removed)
 
R

Ron McNulty

Best way is to use both. Display a few key fields in the
grid, and use a single-record DataList to show all the
fields for the selected record.

Regards

Ron
 

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

Members online

No members online now.

Forum statistics

Threads
473,755
Messages
2,569,536
Members
45,007
Latest member
obedient dusk

Latest Threads

Top