首页 新闻 会员 周边 捐助

用jquery或者js实现 GridView 拉宽 拖动 隐藏

0
悬赏园豆:20 [已关闭问题] 关闭于 2012-12-19 15:26

前台

<%@ 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>
&nbsp;<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>
          &nbsp;</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标题拉宽 拖动 隐藏的功能,

武夜@梦魔的主页 武夜@梦魔 | 初学一级 | 园豆:181
提问于:2011-05-11 09:33
< >
分享
所有回答(1)
0

这么累干嘛,EXTJS里的Grid不错。

6哒忆夏 | 园豆:594 (小虾三级) | 2011-05-11 16:54
没有办法啊。经理要啊。
支持(0) 反对(0) 武夜@梦魔 | 园豆:181 (初学一级) | 2011-05-12 21:24
清除回答草稿
   您需要登录以后才能回答,未注册用户请先注册