Click here to Skip to main content
15,913,264 members
Home / Discussions / C#
   

C#

 
QuestionSize of COM objects Pin
drabiger10-Oct-06 21:33
drabiger10-Oct-06 21:33 
QuestionAdding custom property pages to Outlook 2003 using C# <-- Question Pin
SquallNaruto10-Oct-06 21:15
SquallNaruto10-Oct-06 21:15 
QuestionAssign shortcutkeys to combobox values in gridview Pin
WillemM10-Oct-06 21:04
WillemM10-Oct-06 21:04 
Questionhow to declare 2 dimensional arraylists in C# Pin
Keshav V. Kamat10-Oct-06 21:04
Keshav V. Kamat10-Oct-06 21:04 
AnswerRe: how to declare 2 dimensional arraylists in C# Pin
WillemM10-Oct-06 21:09
WillemM10-Oct-06 21:09 
GeneralRe: how to declare 2 dimensional arraylists in C# Pin
Keshav V. Kamat10-Oct-06 21:11
Keshav V. Kamat10-Oct-06 21:11 
AnswerRe: how to declare 2 dimensional arraylists in C# Pin
wheelerbarry10-Oct-06 22:39
wheelerbarry10-Oct-06 22:39 
AnswerRe: how to declare 2 dimensional arraylists in C# Pin
WillemM10-Oct-06 21:06
WillemM10-Oct-06 21:06 
GeneralRe: how to declare 2 dimensional arraylists in C# Pin
Keshav V. Kamat10-Oct-06 21:08
Keshav V. Kamat10-Oct-06 21:08 
GeneralRe: how to declare 2 dimensional arraylists in C# Pin
WillemM10-Oct-06 21:10
WillemM10-Oct-06 21:10 
Questionanimatiom control Pin
Parshant Verma10-Oct-06 21:01
Parshant Verma10-Oct-06 21:01 
AnswerRe: animatiom control Pin
Alper Camel11-Oct-06 4:32
Alper Camel11-Oct-06 4:32 
QuestionDate Time format in Grid view Pin
Shahzad.Aslam10-Oct-06 20:30
Shahzad.Aslam10-Oct-06 20:30 
QuestionFolder browse exception Pin
Parshant Verma10-Oct-06 19:24
Parshant Verma10-Oct-06 19:24 
AnswerRe: Folder browse exception Pin
quiteSmart10-Oct-06 20:53
quiteSmart10-Oct-06 20:53 
QuestionRe: Folder browse exception Pin
Parshant Verma10-Oct-06 21:04
Parshant Verma10-Oct-06 21:04 
QuestionshList View is not getting cleared Pin
Aslam Bari10-Oct-06 18:26
Aslam Bari10-Oct-06 18:26 
QuestionCreate events for windows User Control.Urgent!!! Pin
RenuKhot10-Oct-06 18:21
RenuKhot10-Oct-06 18:21 
AnswerRe: Create events for windows User Control.Urgent!!! Pin
Aslam Bari10-Oct-06 18:58
Aslam Bari10-Oct-06 18:58 
GeneralRe: Create events for windows User Control.Urgent!!! Pin
RenuKhot10-Oct-06 23:18
RenuKhot10-Oct-06 23:18 
Questionc# and xml Pin
moadbrkt10-Oct-06 16:37
moadbrkt10-Oct-06 16:37 
AnswerRe: c# and xml Pin
Andrei Ungureanu10-Oct-06 19:08
Andrei Ungureanu10-Oct-06 19:08 
GeneralRe: c# and xml Pin
moadbrkt11-Oct-06 12:51
moadbrkt11-Oct-06 12:51 
QuestionHow to use Repeater with c# code? Pin
Ah_Mohsen_aly10-Oct-06 15:55
Ah_Mohsen_aly10-Oct-06 15:55 
AnswerRe: How to use Repeater with c# code? Pin
Chris Buckett10-Oct-06 23:32
Chris Buckett10-Oct-06 23:32 
Wrong forum, it should be in the ASP.NET forum.
But:

in the aspx file:

<br />
...<br />
<asp:Repeater ID="MyRepeater" runat="server"><br />
<ItemTemplate><br />
<br />
///this line shows the MyProductClass.ProductName property for each record.<br />
<%# ((MyProductClass)DataItem.Container).ProductName %><br />
<br />
</ItemTemplate><br />
</asp:Repeater><br />
<br />
...<br />


in the .cs file

Page_Load() 
{
...

//populate a list of products (or use a dataset or datatable or other IEnumerable).
List<MyProductClass> products = MyProductClass.GetProductListFromDatabaseOrSomething();

//set the datasource of the repeater
MyRepeater.DataSource = products;

//databind - this causes the repeater to iterate through the products list.
MyRepeater.DataBind();

...
}


it's usual practice to put the above code within a if (!IsPostBack) {... } block so that it only gets loaded on the first page load rather than after every postback.

Hope that helps,

ChrisB

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.