DataRepeater

Can someone help me how I will format the data in DataRepeater. It is supposed to display values from database in a table format but I cannot format the table.

DataReader will list all the jobs(job posting information) and also has a button there to apply.

how can I put job_title, date posted and job id in one row and make the row a different color and add job description and other information in another row and format the table???/

please help meA datareader can not be assigned to a DataRepeater.

You can right click it in the view in VS.net and click properties. From there you can assign an alternate Item and Item Layouts.Like afterburn said assign the alertnating items css and items css in whatever way you want.
This is generally the code I use for a repeater

<asp:repeater id="customerRepeater" runat="server" >
<headertemplate>
<table>
</headertemplate>
<itemtemplate>
<tr><td><%# DataBinder.Eval(Container.DataItem, "Job_Title_from_DB")%></td><td><asp:button id='button' runat=server text="click me" onclick="button_click" /></td></tr>
</itemtemplate>
<footertemplate>
</table>
</footertemplate>
</asp:repeater>



any help?

NOTE: the code:
<%# DataBinder.Eval(Container.DataItem, "Job_Title_from_DB")%>

will be filled in once the repeater has its data "bound" to it.
So in your code make sure you select the appropriate name from the database when selecting the datasourceYou can download and take a look at the code of the World Recipe application. This app was written in notepad and use declarative/in-line coding, so if you know classic ASP, this is fairly easy for you. But if you use VS.NET it's a bit harder. View the Live demo site before you decide to play around with the code so you'll get an idea what does this application can do to you.

Demo and Download Link: <!-- m --><a class="postlink" href="http://www.myasp-net.com">http://www.myasp-net.com</a><!-- m -->

Hope you'll learn something from this application.

Thanks,
Dexter Zafrathank you so much for your help..

Could you also tell me how can I format the date from the database
I used this code but it is giving some errors

<td><%# string.Format("{0:dd-MMM-yyyy)",((System.Data.Common.DbDataRecord)Container.DataItem)["reply_date"]) %></td>

It says input string is in incorrect format
I wanted to change the format ...you should actually just use the correct parameters. the 3rd option of Container.Eval is a string format. Find which string format meets your needs and use that.the code you have:
{0:dd-MMM-yyyy)

i think should be {0:dd-MMM-yyyy} but if you want a short date just use {0:d} it does the same thing
 
Back
Top