CodeCharge Studio
search Register Login  

Visual PHP Web Development

Visually Create Internationalized Web Applications, Web Reports, Calendars, and more.
CodeCharge.com

YesSoftware Forums -> CodeCharge Studio -> .NET

 How can I access control values in a Repeater (non-edittable grid)?

Print topic Send  topic

Author Message
gpdeering

Posts: 57
Posted: 04/24/2006, 2:57 AM

Hi Everyone,

I'm up against the ropes on this one. I'm new to ASP.NET but need to use it for its sockets namespace.

I started out with a blank page and used the "Form/Record" from the toolbox. Upon submit, the form data will use the "After Insert" action with custom code where the sockets namespace stuff happens. (The data is sent to a third-party DB which provides a connection via sockets. I've already successfully sent data.)

In order to help guide the user's data entry choices, I've implemented a dependent listbox scenario that gets their choices from another DB (MS Access table), which I maintain. By using the client onchange event and some javascript, I'm passing the listbox selections and reloading the page with those selections in the URL.

Now, for the tricky stuff. When the user uses the listboxes, the query against the MS Access table can return more than one match. I need access to the rest of the data from that match. This is the data that will get sent to the third-party DB via sockets.

I used grid builder to put the query result on the page. But how do access each value, say, for a given field in that grid? (ASP was so much easier.)

I've tried to loop through the grid, but I don't even understand the VB.NET syntax that puts the grid on the page in the first place. I see that Nicole offered a very similar tip to do what I'm asking for, but for editable grids.

I've also tried session variables, but they seem to save only the last value for the field.

Anyway, thanks for any help out there.

Glen
View profile  Send private message
Diesel

Posts: 43
Posted: 04/26/2006, 3:15 AM

Hi there

I am using the Editable grid for some of my solutions.

As you probably know if your form name is "FormText" & control name is for example "labeltext" then the ASP.NET generated code will be something like this for a grid with 5 rows.

{FormName}repeater_ctl{rownumber}_{ControlName}

Thus you get something like:

FormTextRepeater_ctl1_labeltext
FormTextRepeater_ctl2_labeltext
FormTextRepeater_ctl3_labeltext
FormTextRepeater_ctl4_labeltext
FormTextRepeater_ctl5_labeltext

Therefore you can run a loop and get your values for each of these controls on the page in runtime. Now you can retrieve the values one by one.

There are some other methods that we use in the Editable grid, by using:

item.{ControlName}.GetFormattedValue()

Thus: item.labeltext.GetFormattedValue()

Hope this helps a bit
View profile  Send private message

Add new topic Subscribe to topic   


These are Community Forums for users to exchange information.
If you would like to obtain technical product help please visit http://support.yessoftware.com.

Web Database

Join thousands of Web developers who build Web applications with minimal coding.
CodeCharge.com

Home   |    Search   |    Members   |    Register   |    Login


Powered by UltraApps Forum created with CodeCharge Studio
Copyright © 2003-2004 by UltraApps.com  and YesSoftware, Inc.