html - How to Put Textbox and Dropdownlist in Gridview for Editing? -
i'm sorry. i'm new @ i'm trying hard. need on how put textbox , dropdownlist in gridview editing.
this codes of gridview
<div id="id_tm1" runat="server" class="grid" style="border: 1px solid black; overflow: scroll; width: 94%; height: 103px" visible="true"> <asp:gridview id="gvgroup" runat="server" allowpaging="true" allowsorting="true" autogeneratecolumns="false" bordercolor="silver" borderwidth="1px" height="77px" width="98%"> <rowstyle font-names="arial" font-size="9pt" horizontalalign="center" /> <columns> <asp:boundfield datafield="jobtitle" headerstyle-backcolor="#666666" headertext="job title" itemstyle-height="10px" itemstyle-width="50px"> <headerstyle backcolor="#666666" /> <itemstyle width="50px" /> </asp:boundfield> <asp:boundfield datafield="business_unit" headerstyle-backcolor="#666666" headertext="business unit" itemstyle-height="10px" itemstyle-width="50px"> <headerstyle backcolor="#666666" /> <itemstyle width="50px" /> </asp:boundfield> <asp:boundfield datafield="division" headerstyle-backcolor="#666666" headertext="division" itemstyle-height="10px" itemstyle-width="50px"> <headerstyle backcolor="#666666" /> <itemstyle width="50px" /> </asp:boundfield> <asp:boundfield datafield="sub_division" headerstyle-backcolor="#666666" headertext="sub-division" itemstyle-height="10px" itemstyle-width="50px"> <headerstyle backcolor="#666666" /> <itemstyle width="50px" /> </asp:boundfield> <asp:boundfield datafield="classification" headerstyle-backcolor="#666666" headertext="classification" itemstyle-height="10px" itemstyle-width="50px"> <headerstyle backcolor="#666666" /> <itemstyle width="50px" /> </asp:boundfield> <asp:boundfield datafield="sub_classification" headerstyle-backcolor="#666666" headertext="sub-classification" itemstyle-height="10px" itemstyle-width="50px"> <headerstyle backcolor="#666666" /> <itemstyle width="50px" /> </asp:boundfield> </columns> <pagerstyle font-size="9pt" horizontalalign="right" /> <emptydatatemplate> <div style="width: 100%; font-size: 10pt; text-align: center; color: red;"> no record found. </div> </emptydatatemplate> <headerstyle backcolor="darkgray" font-bold="true" font-names="arial" font-size="9pt" forecolor="white" horizontalalign="center" /> <alternatingrowstyle backcolor="gainsboro" /> </asp:gridview> </div> i tried put <asp:templatefield> , <asp:dropdownlist> i'm having error "type 'system.web.ui.webcontrols.boundfield' not have public property named 'templatefield' or 'dropdownlist'
the textbox , dropdownlist should appear when click edit button in gridview item list able edit output. thank yoou much.
template field tag not allowed inside boundfield tag, should tag separately example.
<asp:boundfield datafield="jobtitle" headerstyle-backcolor="#666666" headertext="job title"itemstyle-height="10px" itemstyle-width="50px"> <headerstyle backcolor="#666666" /> <itemstyle width="50px" /> </asp:boundfield> <asp:templatefield headertext = "column header" itemstyle-width="95px" headerstyle-horizontalalign="center"> <itemtemplate> <asp:dropdownlist id="yourdroddown" runat="server"> <asp:listitem selected="true">item 1 </asp:listitem> <asp:listitem>item 2</asp:listitem> <asp:listitem>item 3</asp:listitem> </asp:dropdownlist> </itemtemplate> </asp:templatefield>
Comments
Post a Comment