FrankR
Posts: 154
|
Posted: 09/21/2006, 6:24 AM |
|
To date, I have done all grid data access at the Row level, in BeforeShowRow, using
RepeaterItemEventArgs e
and something like
System.Web.UI.WebControls.Literal FORM1DESCRIPTION = (System.Web.UI.WebControls.Literal)(e.Item.FindControl("FORM1DESCRIPTION"));
What if I need to walk through the whole grid, from another grid/panel or button?
Anywhere in the page, how do I
- Get the count of rows
- Walk through the rows
in CCS/C#.NET?
Thanks.
_________________
FR |
|
|
FrankR
Posts: 154
|
Posted: 09/21/2006, 3:19 PM |
|
Well, I'm good and spooked about this, now that the day passed and no one commented.
I tried to read any old thread that might deal with this, and I didn't find any answer - beyond someone suggesting concatenating grid data to a Session variable. Yikes.
If that's the Only way to access data after loading a grid, I'm dead with my project.
Someone tell me there's a legitimate way to do this.
I don't understand how anyone can write anything but the most basic app if there is not the ability to cleanly, programmatically access All data that is on the form. If I have to insert functions in the Before Shows of every column of a grid to store data, I might as well write the data access code myself. Beyond that, storing the data to session variables is Not a good thing to do, and the whole approach falls apart when/if the session expires.
Someone please tell me there's a clean way.
_________________
FR |
|
|
peterr
Posts: 5971
|
Posted: 09/22/2006, 1:49 AM |
|
I believe that this was already answered via support.
_________________
Peter R.
YesSoftware Forums Moderator
For product support please visit http://support.yessoftware.com |
|
|
FrankR
Posts: 154
|
Posted: 09/22/2006, 5:04 AM |
|
A response came in at 4:00am.
I just tried it - and it worked.
Ahhh - I can sleep some this weekend.
For everyone else, the method is:
accessing the protected Repeaters.
i.e.
foreach (RepeaterItem ri in BCN_PCN_MAGIDSRepeater.Items)
{
if (ri.ItemType == ListItemType.Item) || ((ri.ItemType == ListItemType.AlternatingItem)
{
System.Web.UI.WebControls.TextBox BCN_PCN_MAGIDSMAGID = (System.Web.UI.WebControls.TextBox)(ri.FindControl("BCN_PCN_MAGIDSMAGID"));
if (BCN_PCN_MAGIDSMAGID != null)
{
//~~~~ Contents in BCN_PCN_MAGIDSMAGID.Text;
}
}
}
Outstanding - and Thank You Ruslan in CCS support.
_________________
FR |
|
|
Tuong Do
|
Posted: 10/27/2006, 5:55 PM |
|
Hi Frank,
Not anywhere in the page but anywhere below the grid then you can walk
through the grid by using custom code like this
At the begin of the page define a an array list
In the before show row event of the grid store value of the field from the
grid in the array list variable
You now can walk through all the value of the field that you have stored in
the array list variable.
"FrankR" <FrankR@forum.codecharge> wrote in message
news:84512929d57d25@news.codecharge.com...
> To date, I have done all grid data access at the Row level, in
> BeforeShowRow,
> using
>
> RepeaterItemEventArgs e
>
> and something like
>
>
> System.Web.UI.WebControls.Literal FORM1DESCRIPTION =
> (System.Web.UI.WebControls.Literal)(e.Item.FindControl("FORM1DESCRIPTION"));
>
>
> What if I need to walk through the whole grid, from another grid/panel or
> button?
>
> Anywhere in the page, how do I
>
> - Get the count of rows
> - Walk through the rows
>
> in CCS/C#.NET?
>
> Thanks.
> _________________
> FR
> ---------------------------------------
> Sent from YesSoftware forum
> http://forums.codecharge.com/
>
|
|
|
|