Gridview - issue with dropdown

S

sam44

Hi,
I have a dropdown in my gridview :

<asp:TemplateField HeaderText="Analyst">
<EditItemTemplate>
<asp:DropDownList ID="ddAnalyst" runat="server"
DataTextField="FullName"
datavaluefield="UserID" DataSource='<%# GetAllAnalysts() %>'>
</asp:DropDownList>
</EditItemTemplate>
<ItemTemplate>
<asp:Label ID="lblAnalyst" runat="server" Text='<%#
Bind("FullName") %>'></asp:Label>
</ItemTemplate>
</asp:TemplateField>

It works fine, except that when I enter edit mode, the first item in
the dropdown is selected. I would like that the selected item is the
one matching the value for that row. What is the easiest way to do this
?

Thank you
 

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,769
Messages
2,569,582
Members
45,059
Latest member
cryptoseoagencies

Latest Threads

Top