Data Repeater

V

VIswanathan S

Hi All!
How to use Data Repeater in VB.NET?

Data Fields are
Employee Number
Name
Photo
Date of Joining
Salary

I want to use all the fields in Data Repeater?

TIA
Viswanathan S
 
B

Bob Powell [MVP]

Repeaters are usually, but not always, formatted as tables.

The tags within the repeater are for the header, item, alternating items,
footer and separator. You can use databinding statements within the repeater
to format the code.

For example...

<asp:Repeater id="Repeater1" runat="server">
<HeaderTemplate>
<table width="800px">
<tr>
<th>
Identifier</th>
<th>
Language</th>
<th>
Content</th>
<th>
Edit</th>
<th>
Delete</th>
</tr>
</HeaderTemplate>
<ItemTemplate>
<tr>
<td><%# DataBinder.Eval(Container.DataItem,"ident") %></td>
<td><%# DataBinder.Eval(Container.DataItem,"lang") %></td>
<td><%# DataBinder.Eval(Container.DataItem,"content") %></td>
<td>
<asp:Button Runat="server" CommandName="edit" Text="Edit"
CommandArgument='<%# DataBinder.Eval(Container.DataItem,"contentid") %>'
ID="Button1" NAME="Button1">
</asp:Button></td>
<td>
<asp:Button Runat="server" CommandName="delete" Text="Delete"
CommandArgument='<%# DataBinder.Eval(Container.DataItem,"contentid") %>'
ID="Button2" NAME="Button2">
</asp:Button></td>
</tr>
</ItemTemplate>
<AlternatingItemTemplate>
<tr bgcolor="#00cccc">
<td><%# DataBinder.Eval(Container.DataItem,"ident") %></td>
<td><%# DataBinder.Eval(Container.DataItem,"lang") %></td>
<td><%# DataBinder.Eval(Container.DataItem,"content") %></td>
<td>
<asp:Button Runat="server" CommandName="edit" Text="Edit"
CommandArgument='<%# DataBinder.Eval(Container.DataItem,"contentid") %>'
ID="Button3" NAME="Button3">
</asp:Button></td>
<td>
<asp:Button Runat="server" CommandName="delete" Text="Delete"
CommandArgument='<%# DataBinder.Eval(Container.DataItem,"contentid") %>'
ID="Button4" NAME="Button4">
</asp:Button></td>
</tr>
</AlternatingItemTemplate>
<FooterTemplate>
</table>
</FooterTemplate>
</asp:Repeater>

Also.Please will you NOT CROSSPOST!



--
Bob Powell [MVP]
Visual C#, System.Drawing

Ramuseco Limited .NET consulting
http://www.ramuseco.com

Find great Windows Forms articles in Windows Forms Tips and Tricks
http://www.bobpowell.net/tipstricks.htm

Answer those GDI+ questions with the GDI+ FAQ
http://www.bobpowell.net/faqmain.htm

All new articles provide code in C# and VB.NET.
Subscribe to the RSS feeds provided and never miss a new article.
 

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,743
Messages
2,569,478
Members
44,899
Latest member
RodneyMcAu

Latest Threads

Top