Hello Everyone, I have stumbled into a strange issue. I have a GridView with sevEral Columns, two of those Columns have dropdowns. One of the dropdowns works as expected, the other shows the selected value for a second and then reverts to something else.
What makes it strange is that it works fine for 2 out of the 10 values listed in the dropdown.
In the Column template I included a textbox together with the dropdown, but I don't think this will be the issue. I added a break point to the SelectedIndexChange, and by the time it hits the SelectedIndexChange the value has already being changed.
This is a portion of the markup:
<asp:TemplateField FooterText="cCommentDesc" HeaderText="cCommentDesc" SortExpression="cCommentDesc">
<ItemTemplate>
<asp:TextBox ID="txtComment" runat="server" Width="200px"
Text = '<%# Eval("cComment") %>'
ReadOnly="True">
</asp:TextBox>
<asp:DropDownList
ID="cboComment"
runat="server"
DataSourceID = "SQLCommentsDataSource"
DataTextField="cCommentDesc"
DataValueField="cRtnVal"
OnSelectedIndexChanged="cboComment_SelectedIndexChanged"
AutoPostBack="True"
Width="100px"
style="margin-left: 0px;">
</asp:DropDownList>
</ItemTemplate>
</asp:TemplateField>
SQLCommentsDataSource is defined as:
SELECT TOP 1 NULL AS cCommentDesc, NULL AS cRtnVal, 0 As nOrder
FROM DropDownsValues
UNION
SELECT cValue AS cCommentDesc, cRtnVal, nOrder
FROM DropDownsValues
WHERE cKeyName = 'ServerComments'
ORDER BY nOrder
Thank you in advance.
Luis