gridview空间使用
1、HTML代码
<asp:GridView ID="gv_Info" runat="server" AutoGenerateColumns="False" Width="100%" AllowPaging="True" EmptyDataText="没有符合条件的数据信息" PagerSettings-Visible="false"
OnRowDataBound="gv_Info_RowDataBound" OnRowCreated="Info_RowCreated" OnSorting="gv_Info_Sorting" OnDataBound="gv_Info_DataBound">
<Columns>
<asp:BoundField HeaderText="企业代码" DataField="ENTERPRISE_CODE" SortExpression="ENTERPRISE_CODE" Visible="False" />
<asp:BoundField HeaderText="企业名称" DataField="ENTERPRISE_NAME" SortExpression="nlssort(ENTERPRISE_NAME,'NLS_SORT=SCHINESE_PINYIN_M')" />
</Columns>
<PagerStyle HorizontalAlign="Center" />
<EmptyDataTemplate>
没有符合条件的数据信息!
</EmptyDataTemplate>
</asp:GridView>
<Mes:AspNetPager ID="AspNetPager1" runat="server" OnPageChanging="AspNetPager1_PageChanging"></Mes:AspNetPager>
2、后台包含gv_Info_RowDataBound、Info_RowCreated、gv_Info_Sorting、gv_Info_DataBound几个函数
3、SortExpression字段中存放排序字符串。
4、某个单元格绑定函数,打开新的页面弹窗。
a.引用
<script type="text/javascript" src="../../../../js/jquery-1.7.2.js"></script> <script type="text/javascript" src="<%=Page.ResolveUrl("~/") %>Manager/js/jquery.windows-engine.js"></script> <link type="text/css" rel="stylesheet" href="<%= Page.ResolveUrl("~/") %>Manager/Css/jquery.windows-engine.css" />
b.单元格绑定<a>标签及图片数据
<asp:TemplateField HeaderText="参数" SortExpression="Data1"> <ItemTemplate> <a href="javascript:getData('<%# Eval("Data1")%>')"> <img src='<%#GetPicURL_Address(Eval("Data1").ToString(), Eval("Data1").ToString())%>' />
</a>
</ItemTemplate>
</asp:TemplateField>
c.定义函数
<script type="text/javascript"> //打开参数页面 function getData(data1) { debugger $.window.create({ id: "iframeGetData", posx: 500, posy: 100, width: 600, height: 300, title: "参数", type: "iframe", url: 'Data.aspx?data1=' + data1+ '&data2=' + data1 }); } </script>
d.创建一个新的界面 Data.aspx
e.新界面获取传入参数
public string data1= (string)CommonUtil.sink("data1", MethodType.Get, 255, 0, DataType.Str);
public string data2= (string)CommonUtil.sink("data2", MethodType.Get, 255, 0, DataType.Str);