Rank: Newbie Groups: Member
Joined: 3/24/2008 Posts: 8
|
I have populated a grid and after the user has selected a set of features from radio button lists and drop down lists, I want to process the rows in the grid.
Can you help with an example of the for loop to read rhe rows in the grid and how to address a specific column in the row being processed
sample pseudo code:
for (int i = 2; i < grid.RecordCount; i ++) { string CUSIP = grid.row[i].column[2].toString(); RatingRow CurrRating = wsRatings.GetCurrentRating(CUSIP); grid.row[i].column[3] = CurrRating["Rating"].ToString(); grid.row[i].column[4] = CurrRating["RatingDate"].ToString(); }
Thanks.
Mike B.
|
Rank: Administration Groups: Administration
Joined: 5/27/2007 Posts: 24,193
|
Hi Mike, I believe it can be done by something like this:
Code: C#
for (int i = 2; i < grid.Items.Count; i++)
{
string CUSIP = grid.Items[i].Cells[2].ToString();
RatingRow CurrRating = wsRatings.GetCurrentRating(CUSIP);
grid.Items[i].Cells[3] = CurrRating["Rating"].ToString();
grid.Items[i].Cells[4] = CurrRating["RatingDate"].ToString();
}
The key is row[x] -> Items[x], column[x] ->Cells[x]. You can find all the reference information at here: http://www.essentialobjects.com/ViewDoc.aspx?t=EO.Web.htmlThanks!
|