Hi there,
Dunno if any of you guys know much about ASP.NET but I have a slight problem concerning editing data within a datagrid which I would like to pick your 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:
<EditItemTemplate>
<asp DropDownList runat="server"
SelectedIndex='<%# GetStateIndex(Container.DataItem("state")) %>'
id="edit_State">
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:
Parser Error Message: The 'SelectedIndex' property is set only by the runtime. It cannot be declared.
Any ideas on how I can get around this would be very much appreciated.
cheers,
Dunno if any of you guys know much about ASP.NET but I have a slight problem concerning editing data within a datagrid which I would like to pick your 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:
<EditItemTemplate>
<asp DropDownList runat="server"
SelectedIndex='<%# GetStateIndex(Container.DataItem("state")) %>'
id="edit_State">
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:
Parser Error Message: The 'SelectedIndex' property is set only by the runtime. It cannot be declared.
Any ideas on how I can get around this would be very much appreciated.
cheers,
Comment