Click here to Skip to main content
15,885,027 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
XML
<asp:TemplateField HeaderText="Status">
                                                    <ItemTemplate>
                                                        <asp:DropDownList ID="ddlStatus" runat="server" class="span3" ClientIDMode="Static"
                                                            placeholder="Status" Style="width: 70%" Text='<%# Eval("Status") %>'>
                                                        </asp:DropDownList>
                                                    </ItemTemplate>
                                                    <FooterStyle HorizontalAlign="Left" />
                                                    <HeaderStyle HorizontalAlign="Left" />
                                                    <ItemStyle HorizontalAlign="Left" />
                                                </asp:TemplateField>




Source Error:


Line 305: {
Line 306: gvUTestDetails.DataSource = dtAttachment;
Line 307: gvUTestDetails.DataBind();
Line 308: //btnClick.Style.Add("display", "none");
Line 309: }
Posted
Comments
nandakishoreroyal 14-Mar-14 3:18am    
Explain question Briefly...
nandakishoreroyal 14-Mar-14 3:20am    
"gvUTestDetails" is ID of gridview right?


in gvUTestDetails_RowCreated method you get the id of dropdown and set selected value..
Amol Jadhao 14-Mar-14 4:21am    
bind a dropdownlist in RowDataBound event of gridview and in sourcecode bind below code
SelectedValue='<%# Bind ("StatusId") %>'
ZurdoDev 14-Mar-14 16:57pm    
The error says you have tried to set the value to something that isn't in the datasource.

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

  Print Answers RSS
Top Experts
Last 24hrsThis month


CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900