前台
<%@ Page Language="C#" AutoEventWireup="true" CodeFile="副本 Default.aspx.cs" Inherits="Gridview_Default" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" >
<head runat="server">
<title>GridView</title>
<link rel="stylesheet" type="text/css" href="xpTable.css" />
<link href="css/flexigrid.css" rel="stylesheet" type="text/css" />
<script src="js/jq.js" type="text/javascript"></script>
<script src="js/AjaxJS.js" type="text/javascript"></script>
<script src="js/flexigrid.js" type="text/javascript"></script>
<script language="javascript" type="text/javascript">
function select()
{
var Url="Default2.aspx";
var result=window.showModalDialog(Url,'','dialogWidth:590px;status:no;dialogheight:500px');
if(result!=null)
{
document.getElementById("TextBox1").value="chenggong";
}
}
</script>
</head>
<body>
<form id="form1" runat="server">
<input id="Button1" type="button" value="button" onclick="return select()" />
<asp:TextBox ID="TextBox1" runat="server"></asp:TextBox>
<br />
<br />
<br />
<br />
<div style="height:500; width:auto">
<asp:GridView ID="GridView1" CssClass="flexme2" runat="server" >
<HeaderStyle Font-Bold="True" HorizontalAlign="Center"></HeaderStyle>
<Columns>
<asp:BoundField DataField="ID" HeaderText="ID" SortExpression="ID" />
<asp:BoundField DataField="Name" HeaderText="Name" SortExpression="Name" />
<asp:BoundField DataField="WebSite" HeaderText="WebSite" SortExpression="WebSite" />
<asp:TemplateField HeaderText="选择">
<ItemTemplate>
<asp:CheckBox ID="CheckBox1" runat="server" />
</ItemTemplate>
</asp:TemplateField>
</Columns>
</asp:GridView>
</div>
<div style="height:500; width:auto">
<table width="800" class="flexme">
<thead>
<tr>
<th width="70">
id</th>
<th width="100">
name</th>
<th width="100">
WebSite</th>
</tr>
</thead>
<asp:Repeater ID="OrderList" runat="server">
<ItemTemplate>
<tr>
<td><%#Eval("ID")%>
</td>
<td>
<%#Eval("Name")%>
</td>
<td><%#Eval("WebSite")%></td>
</tr>
</ItemTemplate>
</asp:Repeater>
</div>
</form>
<script type="text/javascript">
$('.flexme2').flexigrid();
$('.flexme').flexigrid({height:'auto',striped:false});
</script>
</div>
<p>
</p>
</body>
</html>
后台
using System;
using System.Data;
using System.Configuration;
using System.Collections;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Web.UI.HtmlControls;
using System.Xml;
public partial class Gridview_Default : System.Web.UI.Page
{
protected void Page_Load(object sender, EventArgs e)
{
DataSet ds=new DataSet();
ds.ReadXml(Server.MapPath("chy.xml"));
this.GridView1.DataSource = ds;
this.GridView1.DataBind();
OrderList.DataSource = ds;
this.OrderList.DataBind();
}
}
用jquety实现了Repeater标题拉宽 拖动 隐藏 但是用到gridview上就用不上。我要的就是在asp.net用jquety或者js 实现gridview标题拉宽 拖动 隐藏的功能,
这么累干嘛,EXTJS里的Grid不错。