User1811156929 posted
Hi Friends,
Actually i tried to set selected value of Gridview (Inline Code) if the list items are int(1,2,..) it is working but if i use char(A,B,..) it through error like "invalid because it does not exist in the list of items".
<asp:TemplateField HeaderText="SinterLottype" SortExpression="SinterLottype">
<EditItemTemplate>
<asp:DropDownList ID="ddSntrLTtyp" runat="server" SelectedValue ='<%# Bind("SinterLottype") %>' >
<asp:ListItem>A</asp:ListItem>
<asp:ListItem>B</asp:ListItem>
</asp:DropDownList>
</EditItemTemplate>
<ItemTemplate>
<asp:Label ID="lblSntrtyp" runat="server" Text='<%# Bind("SinterLottype") %>'></asp:Label>
</ItemTemplate>
</asp:TemplateField>
In the selectedvalue code any conversion required? Pls suggest