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

 value of dropdown in editable grid

Print topic Send  topic

Author Message
jplanet

Posts: 2
Posted: 04/30/2004, 8:03 AM

I have an editable grid, which needs to do the following:

Each row needs a button, when executed it executes a stored proc.
The proc needs the selected value of a dropdown as a parameter.

So, I created a button, added the following code to the onclick event:

System.Web.HttpContext context=System.Web.HttpContext.Current;
DataAccessObject NewDao=Settings.SunriseDataAccessObject;
string Sql = "exec RoomAllElevations '{ListBox1}'";
NewDao.RunSql(Sql);

The proc successfully executes, although it is accepting the string literal '{ListBox1}', and not the actual value of the current row's listbox value. Any idea what variable will return the variable of the currently selected item?

View profile  Send private message
Stan
Posted: 05/04/2004, 12:57 AM

Hi

Try the following trick

firstly obtain the rpeater item, which correspond to the pressed button

RepeaterItem item = e.Item;

then find the listbox in item collection

HtmlSelect ListBox1 = (HtmlSelect)(item.FindControl("<EditableGridName>ListBox1");

after this you can obtain the selected value from listbox

string Sql = "exec RoomAllElevations '"+ListBox1.Value+"'";

Stan

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.