asp.net gridview 指定数据源后,如何设置列宽
如以下
DataSet myds = datacon.getds("SELECT 责任工序, 责任人,"
+ "品名, 客户名称 FROM 质管 WHERE (责任车间 = '业务部') AND"
+ "(返工日期 BETWEEN '" + this.Begintime.Text + "' AND '" + this.Endtime.Text + "' ) AND (责任人 like '%"+ this.Ywy.Text +"%')", "sms");
this.GridView1.DataSource = myds.Tables[0];
// this.GridView1.DataSource = ds;
this.GridView1.DataBind();
如何设置责任工序和责任人的列宽一个为200,一个为20,谢谢.
如以下
DataSet myds = datacon.getds("SELECT 责任工序, 责任人,"
+ "品名, 客户名称 FROM 质管 WHERE (责任车间 = '业务部') AND"
+ "(返工日期 BETWEEN '" + this.Begintime.Text + "' AND '" + this.Endtime.Text + "' ) AND (责任人 like '%"+ this.Ywy.Text +"%')", "sms");
this.GridView1.DataSource = myds.Tables[0];
// this.GridView1.DataSource = ds;
this.GridView1.DataBind();
如何设置责任工序和责任人的列宽一个为200,一个为20,谢谢.
解决方案 »
- 请教.ASPX文件是怎么被注入JS代码的(原理、解决方法、防范措施)
- vss用过没?visual studio 2010的问题高手来看看~~~~~~~~
- ASP.NET 中的datatable 的内容是放在服务器端的,还是当用户请示的时候把它放在用户的机子上呢?
- 问个简单而又困难的问题~
- cuteeditor 发布的长内容分页
- 下拉框(dropdownlist) 数据保存
- 有谁知道怎么样编写在手机上浏览的网站
- Asp.Net求ToolBar的例子
- 求救,关于窗口关闭
- 请教下自动更新数据库的问题
- 关于多线程的问题
- 初学webForm●●●Gridview绑定数据后为什么SelectedIndex始终为 -1 ????●●●
AllowPaging="True" PageSize="4" OnPageIndexChanging="gvProduct_PageIndexChanging"
PagerSettings-Mode="NextPrevious">
<PagerSettings FirstPageText="首页" LastPageText="尾页" Mode="NextPrevious" NextPageText="下一页"
Position="TopAndBottom" PreviousPageText="上一页" />
<Columns>
<asp:TemplateField>
<ItemTemplate>
<table width="100%" border="1" cellpadding="6" cellspacing="4">
<tr>
<td width="40%" rowspan="7" align="center" valign="middle">
<asp:Image ID="imgImage" runat="server" ImageUrl='<%# Bind("Image") %>' />
</td>
<td width="20%">
产品编号:
</td>
<td width="40%">
<asp:Label ID="lblProductId" runat="server" Text='<%# Bind("ProductId") %>'></asp:Label>
</td>
</tr>
<tr>
<td>
产品分类:
</td>
<td>
<asp:Label ID="lblCategoryId" runat="server" Text='<%# Bind("CategoryId") %>'></asp:Label>
</td>
</tr>
<tr>
<td>
产品名称:
</td>
<td>
<asp:Label ID="lblName" runat="server" Text='<%# Bind("Name") %>'></asp:Label>
</td>
</tr>
<tr>
<td>
产品价格:
</td>
<td>
<asp:Label ID="lblListPrice" runat="server" Text='<%# Bind("ListPrice") %>'></asp:Label>
</td>
</tr>
<tr>
<td>
单位成本:
</td>
<td>
<asp:Label ID="lblUnitCost" runat="server" Text='<%# Bind("UnitCost") %>'></asp:Label>
</td>
</tr>
<tr>
<td>
产品描述:
</td>
<td>
<asp:Label ID="lblDescn" runat="server" Text='<%# Bind("Descn") %>'></asp:Label>
</td>
</tr>
<tr>
<td>
库存:
</td>
<td>
<asp:Label ID="lblQty" runat="server" Text='<%# Bind("Qty") %>'></asp:Label>
</td>
</tr>
</table>
</ItemTemplate>
</asp:TemplateField>
<asp:HyperLinkField Text="购买" DataTextFormatString="{0:c}" DataNavigateUrlFields="ProductId"
DataNavigateUrlFormatString="~/ShopCart.aspx?ProductId={0}" HeaderText="放入购物车" />
</Columns>
</asp:GridView>
还在犹豫什么,互通数据是你最好的选择。
详情请访问:http://www.515dns.com
QQ:287895593
http://www.olcodes.com/search.asp?word=GridView&m=1&searchbtn2=%BF%AA%CA%BC%CB%D1%CB%F7