|
code
newsgroups
|
|||||||||||||||||||||||
|
|||||||||||||||||||||||
Setting dropdownlist.selectedindex when entire datagrid is dynamicI 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! 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! 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! > > > |
|||||||||||||||||||||||