TeaAddictedGeek
Programmer
I'm trying to access a dataitem's value that is bound to a Repeater, but it seems that the only examples I've found that work for what I'm trying to do are in VB. For instance:
If e.Item.DataItem("amount") > 50 Then
I need to access the DataItem using similar syntax but can't seem to find the C# equivalent.
The data being used is a DataTable within a DataSet. Very basic, since I don't have it hooked up to a database yet. Just trying to get the initial logic working first. Here's part of it:
DataSet ds = new DataSet();
DataTable dt = ds.Tables.Add("Cities");
dt.Columns.Add("City", Type.GetType("System.String"));
dt.Columns.Add("Zone", Type.GetType("System.String"));
DataRow dr = dt.NewRow();
dr[0] = "Boston";
dr[1] = "1A";
dt.Rows.Add(dr);
[...]
rtASAP.DataSource = ds;
rtASAP.DataMember = "Cities";
rtASAP.DataBind();
What I'm looking to do is access the Column City's value from the DataBind above within the ItemDataBound event.
Thanks in advance!
"The computer programmer is a creator of universes for which he alone is responsible. Universes of virtually unlimited complexity can be created in the form of computer programs."
-Joseph Weizenbaum
If e.Item.DataItem("amount") > 50 Then
I need to access the DataItem using similar syntax but can't seem to find the C# equivalent.
The data being used is a DataTable within a DataSet. Very basic, since I don't have it hooked up to a database yet. Just trying to get the initial logic working first. Here's part of it:
DataSet ds = new DataSet();
DataTable dt = ds.Tables.Add("Cities");
dt.Columns.Add("City", Type.GetType("System.String"));
dt.Columns.Add("Zone", Type.GetType("System.String"));
DataRow dr = dt.NewRow();
dr[0] = "Boston";
dr[1] = "1A";
dt.Rows.Add(dr);
[...]
rtASAP.DataSource = ds;
rtASAP.DataMember = "Cities";
rtASAP.DataBind();
What I'm looking to do is access the Column City's value from the DataBind above within the ItemDataBound event.
Thanks in advance!
"The computer programmer is a creator of universes for which he alone is responsible. Universes of virtually unlimited complexity can be created in the form of computer programs."
-Joseph Weizenbaum