SelectedIndex of Dropdownlist in Datagrid

K

Kay Chan

Hi All,

I am going to using a editable datagrid, one of the field should be a
dropdownlist, here is my code
<EditItemTemplate>
<asp:DropDownList
ID="INVESTMENT_FUND_ID"
DataSource="<%# getINVESTMENT_FUND() %>"
DataTextField="NAME"
DataValueField="VALUE"
runat="server"
CssClass="table_list_item_text" Width="230px">
</asp:DropDownList>
</EditItemTemplate>

It is fine. But when I want to set the default SelectedIndex, I added
SelectedIndex="<%# getSelectedIndex() %>"
into the aspx, but the error occurs

Parser Error Message: The 'SelectedIndex' property is set only by the
runtime. It cannot be declared.

Version Information: Microsoft .NET Framework Version:1.1.4322.2032; ASP.NET
Version:1.1.4322.2032

Any other method I can solve this issue?


Thank you!

Regards,
Alan
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,994
Messages
2,570,223
Members
46,812
Latest member
GracielaWa

Latest Threads

Top