Home All Groups Group Topic Archive Search About

Setting dropdownlist.selectedindex when entire datagrid is dynamic

Author
25 Mar 2005 6:37 PM
NancyA
I have a dynamic datagrid that is created using records in a SQL table.  The
datagrid functions perfectly in both view and edit modes.  The only thing
left to do is to figure out how to set the SelectedIndex property of any
DropDownLists in the grid to the correct value when the user clicks the Edit
button so that they default to the current value from the record.  I would
appreciate any help!

Author
25 Mar 2005 8:51 PM
JV
I think you're going to need to put code into the DataGrid's  ItemDataBound
event for this.  You can find samples of using this event in the DataGrid
online help.

Show quote
"NancyA" <anonym***@discussions.microsoft.com> wrote in message
news:BB7B8622-37BC-4C81-9561-48858DE09358@microsoft.com...
>I have a dynamic datagrid that is created using records in a SQL table.
>The
> datagrid functions perfectly in both view and edit modes.  The only thing
> left to do is to figure out how to set the SelectedIndex property of any
> DropDownLists in the grid to the correct value when the user clicks the
> Edit
> button so that they default to the current value from the record.  I would
> appreciate any help!
Author
28 Mar 2005 4:59 PM
NancyA
JV - Thanks for the suggestion, but that won't do it as the fields don't seem
to be accessible since they are dynamic.  Any other good suggestions out
there?

Show quote
"JV" wrote:

> I think you're going to need to put code into the DataGrid's  ItemDataBound
> event for this.  You can find samples of using this event in the DataGrid
> online help.
>
> "NancyA" <anonym***@discussions.microsoft.com> wrote in message
> news:BB7B8622-37BC-4C81-9561-48858DE09358@microsoft.com...
> >I have a dynamic datagrid that is created using records in a SQL table.
> >The
> > datagrid functions perfectly in both view and edit modes.  The only thing
> > left to do is to figure out how to set the SelectedIndex property of any
> > DropDownLists in the grid to the correct value when the user clicks the
> > Edit
> > button so that they default to the current value from the record.  I would
> > appreciate any help!
>
>
>

AddThis Social Bookmark Button