Friday, March 16, 2012

Passing a variable in the onLoad event.

I have a data grid with multiple rows. Each row has a drop down box. I need
it to select the correct item for each row. What I am trying to figure out,
is can I pass a value to the onLoad event for the dropdownlist?

OnLoad="loadDefault(Container.DataItem("dropValue"))"Are you trying to put a selected index?

"Robin Bonin" <robin@.guavatools.com> wrote in message
news:Sr6dnWpfNfAlKIiiXTWJiA@.eatel.net...
> I have a data grid with multiple rows. Each row has a drop down box. I
need
> it to select the correct item for each row. What I am trying to figure
out,
> is can I pass a value to the onLoad event for the dropdownlist?
> OnLoad="loadDefault(Container.DataItem("dropValue"))"
I know the value of the selectedIndex, and that is what I'm trying to
select.

"Cristian Suazo" <crillus7@.hotmail.com> wrote in message
news:O$93Kq9SDHA.1724@.TK2MSFTNGP10.phx.gbl...
> Are you trying to put a selected index?
> "Robin Bonin" <robin@.guavatools.com> wrote in message
> news:Sr6dnWpfNfAlKIiiXTWJiA@.eatel.net...
> > I have a data grid with multiple rows. Each row has a drop down box. I
> need
> > it to select the correct item for each row. What I am trying to figure
> out,
> > is can I pass a value to the onLoad event for the dropdownlist?
> > OnLoad="loadDefault(Container.DataItem("dropValue"))"
Just set the selected index in the code behind: myDropDown.SelectedIndex =
intSelectedIndex

--
S. Justin Gengo, MCP
Web Developer / Programmer

Free Code Library At:
www.aboutfortunate.com

"Out of chaos comes order."
Nietzche

"Robin Bonin" <robin@.guavatools.com> wrote in message
news:foidna-hLOZ1JIiiXTWJjg@.eatel.net...
> I know the value of the selectedIndex, and that is what I'm trying to
> select.
>
> "Cristian Suazo" <crillus7@.hotmail.com> wrote in message
> news:O$93Kq9SDHA.1724@.TK2MSFTNGP10.phx.gbl...
> > Are you trying to put a selected index?
> > "Robin Bonin" <robin@.guavatools.com> wrote in message
> > news:Sr6dnWpfNfAlKIiiXTWJiA@.eatel.net...
> > > I have a data grid with multiple rows. Each row has a drop down box. I
> > need
> > > it to select the correct item for each row. What I am trying to figure
> > out,
> > > is can I pass a value to the onLoad event for the dropdownlist?
> > > > OnLoad="loadDefault(Container.DataItem("dropValue"))"
> >

0 comments:

Post a Comment