dev 官网
2015-10-15 23:08
363 查看
https://www.devexpress.com/Support/Center/Example/Details/E1343
<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="WebForm1.aspx.cs" Inherits="WebApplication15.WebForm1" %>
<%@ Register Assembly="DevExpress.Web.v15.1, Version=15.1.7.0, Culture=neutral, PublicKeyToken=b88d1754d700e49a" Namespace="DevExpress.Web" TagPrefix="dx" %>
<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
<meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
<title></title>
<script type="text/javascript">
function aa() {
grid.SelectionChanged();
}
function SelChanged(s, e) {
//var cbSelName = "cbCheck" + e.visibleIndex;
//if (eval(cbSelName).GetInputElement() != null)
// eval(cbSelName).SetChecked(s.IsRowSelectedOnPage(e.visibleIndex));
var key = s.GetRowKey(e.visibleIndex);
alert(key);
}
function OnGridSelectionComplete(values) {
var str = "No: " + values[0] + ", Name: " + values[1] ;
selDescription.SetValue(str);
}
</script>
</head>
<body>
<form id="form1" runat="server">
<div>
<dx:ASPxMemo ID="selDescription" runat="server" EnableClientSideAPI="true" />
<br />
<dx:ASPxGridView ID="ASPxGridView1" KeyFieldName="No" ClientInstanceName="grid" runat="server" AutoGenerateColumns="False">
<SettingsPager PageSize="30" Position="Bottom" >
</SettingsPager>
<Settings ShowGroupPanel="True" ShowGroupFooter="VisibleAlways"></Settings>
<SettingsBehavior AllowFixedGroups="False" AllowGroup="True" AllowDragDrop="True"/>
<Columns>
<dx:GridViewDataTextColumn FieldName="No" UnboundType="Integer" VisibleIndex="0">
</dx:GridViewDataTextColumn>
<dx:GridViewDataTextColumn FieldName="Name" UnboundType="String" VisibleIndex="1">
</dx:GridViewDataTextColumn>
</Columns>
<GroupSummary>
<dx:ASPxSummaryItem DisplayFormat="合计:0" FieldName="Name" SummaryType="Sum" />
</GroupSummary>
<ClientSideEvents SelectionChanged="function(s, e) { SelChanged(s, e); }" />
</dx:ASPxGridView>
</div>
</form>
</body>
</html>
<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="WebForm1.aspx.cs" Inherits="WebApplication15.WebForm1" %>
<%@ Register Assembly="DevExpress.Web.v15.1, Version=15.1.7.0, Culture=neutral, PublicKeyToken=b88d1754d700e49a" Namespace="DevExpress.Web" TagPrefix="dx" %>
<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
<meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
<title></title>
<script type="text/javascript">
function aa() {
grid.SelectionChanged();
}
function SelChanged(s, e) {
//var cbSelName = "cbCheck" + e.visibleIndex;
//if (eval(cbSelName).GetInputElement() != null)
// eval(cbSelName).SetChecked(s.IsRowSelectedOnPage(e.visibleIndex));
var key = s.GetRowKey(e.visibleIndex);
alert(key);
}
function OnGridSelectionComplete(values) {
var str = "No: " + values[0] + ", Name: " + values[1] ;
selDescription.SetValue(str);
}
</script>
</head>
<body>
<form id="form1" runat="server">
<div>
<dx:ASPxMemo ID="selDescription" runat="server" EnableClientSideAPI="true" />
<br />
<dx:ASPxGridView ID="ASPxGridView1" KeyFieldName="No" ClientInstanceName="grid" runat="server" AutoGenerateColumns="False">
<SettingsPager PageSize="30" Position="Bottom" >
</SettingsPager>
<Settings ShowGroupPanel="True" ShowGroupFooter="VisibleAlways"></Settings>
<SettingsBehavior AllowFixedGroups="False" AllowGroup="True" AllowDragDrop="True"/>
<Columns>
<dx:GridViewDataTextColumn FieldName="No" UnboundType="Integer" VisibleIndex="0">
</dx:GridViewDataTextColumn>
<dx:GridViewDataTextColumn FieldName="Name" UnboundType="String" VisibleIndex="1">
</dx:GridViewDataTextColumn>
</Columns>
<GroupSummary>
<dx:ASPxSummaryItem DisplayFormat="合计:0" FieldName="Name" SummaryType="Sum" />
</GroupSummary>
<ClientSideEvents SelectionChanged="function(s, e) { SelChanged(s, e); }" />
</dx:ASPxGridView>
</div>
</form>
</body>
</html>
相关文章推荐
- Android项目下各文件夹及文件详解
- Ubuntu14.04安装wineqq国际版
- Android四大组件之一:BroadcastReceiver应用详解(带实例)
- iOS:核心动画具体的类和协议的介绍
- 自定义cell
- 连载《一个程序猿的生命周期》- 39、年底,历时一个月找工作,无奈中前行
- 迅雷校招 面试经历
- Machine Learning 20151015
- 中断
- C 常用库函数memset,编译器宏定义assert
- 华为交换机ACL配置的一些东西
- 在.net中使用GAC
- surfaceView
- WEB技术之四层架构
- IOS学习笔记-perFormSelector,RunLoop,Debug神器,UIResponder,Cocoa Touch事件处理
- C# 中引用类型和 值类型
- 【一些事晚报】iPhone6s港台退货潮
- u盘安装centos7
- Linux安装gcc编译器详解(CentOS 6.6 64位系统)
- CoreData(数据持久化的方式)