dolbs
asked on
How do I preselect the current database value in a populated datagrid dropdown list when in edit mode.
First off thanks to Rafayali for his code which I am using.
I have a editable datagrid incorporating a dropdownlist pouplated with data from the database. The function in the attached code sippet is part of the edit template which populates the dropdownlist. (thanks again Rafayali). The problem is I cannot manage to select the current cell value in the dropdownlist so that the user sees the currently stored database value selected in the dropdownlist. I have tried many searched solutions but so far not able to find one that works. Can someone please help me out (VB code would be great as my C insn't great) Thank you all.
I have a editable datagrid incorporating a dropdownlist pouplated with data from the database. The function in the attached code sippet is part of the edit template which populates the dropdownlist. (thanks again Rafayali). The problem is I cannot manage to select the current cell value in the dropdownlist so that the user sees the currently stored database value selected in the dropdownlist. I have tried many searched solutions but so far not able to find one that works. Can someone please help me out (VB code would be great as my C insn't great) Thank you all.
<EditItemTemplate>
<asp:DropDownList
ID="DDLPI"
AutopostBack = "False"
Runat="server"
DataTextField = "NameInitial"
DataValueField = "ID"
Datasource='<%# BindDDL2()%>'/>
</asp:DropdownList>
</EditItemTemplate>
</asp:TemplateColumn>
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER