dr_manhattan
New member
- Joined
- Mar 14, 2005
- Messages
- 3
- Programming Experience
- 1-3
Hi there,
I have a slight problem concerning editing data within a datagrid which I would like to pick your collective brains on.
I have a datagrid, each row with an edit button. When a row is put into edit mode one of the columns is displayed as a dropdownlist.
The problem is I cannot seem to set the selected value for this dropdownlist. I have found a couple of guides which suggest I can simply set the selectedIndex property in the HTML like so:
However, in the Visual Studio property box the SelectedIndex property is greyed out
and when i attempt to run the page I receive the following error message:
[font=Arial, Helvetica, Geneva, SunSans-Regular, sans-serif] Parser Error Message: The 'SelectedIndex' property is set only by the runtime. It cannot be declared.[/font]
Any ideas on how I can get around this would be very much appreciated.
cheers,
I have a slight problem concerning editing data within a datagrid which I would like to pick your collective brains on.
I have a datagrid, each row with an edit button. When a row is put into edit mode one of the columns is displayed as a dropdownlist.
The problem is I cannot seem to set the selected value for this dropdownlist. I have found a couple of guides which suggest I can simply set the selectedIndex property in the HTML like so:
VB.NET:
[/color][/size][size=3][color=blue]<[/color][color=maroon]EditItemTemplate[/color][color=blue]>[/color]
[color=blue][b] <asp:DropDownList runat="server"
SelectedIndex='<%# GetStateIndex(Container.DataItem("state")) %>' [/b][/color]
id="edit_State"[color=blue]>[/color][/size][size=3][color=blue]
However, in the Visual Studio property box the SelectedIndex property is greyed out
and when i attempt to run the page I receive the following error message:
[font=Arial, Helvetica, Geneva, SunSans-Regular, sans-serif] Parser Error Message: The 'SelectedIndex' property is set only by the runtime. It cannot be declared.[/font]
Any ideas on how I can get around this would be very much appreciated.
cheers,