I have a dropdownlist in a datagrid and want to set the initial value of said droplist. I populate the elements in the dropdownlist in the ItemDataBound event.
<asp:DataGrid ID="IssuesDataGrid" runat="server">
<Columns>
<asp:TemplateColumn HeaderText="Resolution">
<ItemTemplate>
<asp:DropDownList ID="ddlResolution"
skinID="smallDropDown"
runat="server"
Enabled="true"
/>
</ItemTemplate>
</asp:TemplateColumn>
</Columns>
</asp:DataGrid>
I am wondering how to go about setting the initial selected value of the datagrid. I want to set it to the value of resolutionID, which is in the query that populates the datagrid.
Is there any easy way to put that right into the aspx page where I create the dropdownlist?
Or is there some way in my ItemDataBound event to access the value of resolutionID, which is coming from the database?
My third option would be to add a bound column to the datagrid with this initial value... but I'd like to find a way to do this without this extra column if possible.