MultiLine Grid View

M

mosscliffe

Dear All,

I am still finding my way around Visual Web Developer, but I have hit a
problem.

I would like to either use a multiline gridview or a less detailed, but
multi record detail view, using the standard controls

eg

Record 1 ID Field 2 Field 3
Field 4
Field 5 Field 6
Record 2 ID Field 2 Field 3
Field 4
Field 5 Field 6
..
.. etc
..
Record n ID Field 2 Field 3
Field 4
Field 5 Field 6

Is it possible to achieve the above with the Standard Controls or will
I have to make my own using tables and if so what is the best way of
achieving this. I will want to edit, delete and insert records.

Thanks

Richard
 
M

mosscliffe

I am sure your answer is correct, but at the moment I have no idea how
to implement an Item Template. Is there a simple example using say two
fields from a record displayed on two separate lines in a grid view.

Thanks in advance

Richard
 
E

Eliyahu Goldin

You need to use an ItemTemplate. In the template make your own multi-line
html layout, using a table being on of the options.

Eliyahu
 
E

Eliyahu Goldin

Richard,

I forgot to mention that you should use a repeater rather than a gridview:

<asp:Repeater id=Repeater1 runat="server" DataSource=...>

<HeaderTemplate>
<table>
</HeaderTemplate>

<ItemTemplate>
<tr><td>
<table>
<tr>
<td><%# Eval("ID") %></td>
<td><%# Eval("Field2") %></td>
<td><%# Eval("Field3") %></td>
</tr>
<tr>
<td colspan=3><%# Eval("Field4") %></td>
</tr>
<tr>
<td><%# Eval("Field5") %></td>
<td colspan=2><%# Eval("Field6") %></td>
</tr>
</table>
</td></tr>
</ItemTemplate>

<FooterTemplate>
</table>
</FooterTemplate>

</asp:Repeater>

Eliyahu
 
M

mosscliffe

Great - Thank you very much. It works well.

On looking into this further, I am confused yet again.

How do a repeater control and a datalist control differ. I want to be
able to use the same display to Insert, Update and Delete Records, so
which one should I use and can you point me to an example of their use.

I accept I am quite thick about this, but all these controls and
methods are a steep learning curve for me.

Thanks in advance

Richard
 

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,999
Messages
2,570,243
Members
46,838
Latest member
KandiceChi

Latest Threads

Top