更新时间:2022-05-25 02:01:40
使用Templatefield而不是boundfield
< asp:TemplateField HeaderText =Item Name>
< itemtemplate>
< asp:Label ID =itemrunat =serverText =''<%#Bind(Itemname)%>''>
< edititemtemplate>
< asp:DropDownList ID =ddlitemname1runat =serverWidth =120px
DataSourceID =SqlDataSource2DataTextField =Itemname
DataValueField =ItemnameAutoPostBack =TrueSelectedValue =''<%#Bind(Itemname)%> ; '' >
< asp:SqlDataSource ID =SqlDataSource2runat =server
ConnectionString =<%
Use Templatefield rather than boundfield
<asp:TemplateField HeaderText="Item Name" >
<itemtemplate>
<asp:Label ID="item" runat="server" Text=''<%# Bind("Itemname") %>''>
<edititemtemplate>
<asp:DropDownList ID="ddlitemname1" runat="server" Width="120px"
DataSourceID="SqlDataSource2" DataTextField="Itemname"
DataValueField="Itemname" AutoPostBack="True" SelectedValue=''<%# Bind("Itemname") %>''>
<asp:SqlDataSource ID="SqlDataSource2" runat="server"
ConnectionString="<%
ConnectionStrings:hospital%> SelectCommand =SELECT DISTINCT [Itemname],[Qty] FROM [Purchaseentry]>
< HeaderStyle CssClass =headersalestylelistWidth =120px/>
< itemstyle width =120pxhorizontalalign =Center>
和
for edit
单击gridview corner并选择Enable Editing,Enable Deleting等
ConnectionStrings:hospital %>" SelectCommand="SELECT DISTINCT [Itemname],[Qty] FROM [Purchaseentry]">
<HeaderStyle CssClass="headersalestylelist" Width="120px" />
<itemstyle width="120px" horizontalalign="Center">
and
for edit
click on gridview corner and select Enable Editing, Enable Deleting etc
this.gridView.Columns[x]. any thing