datagrid

Datagrid列表控件使用

ε祈祈猫儿з 提交于 2020-03-25 21:15:05
三种列表控件比较: Datagrid 优点:1.灵活性强,内置事件丰富 2.提供分页、编辑、排序等特性 3.功能强大的Datagrid编辑器以及模板列 4.快速开发、容易部署 5.对于表格的操作非常方便 6.内置多种布局风格 缺点:1.性能不高,因为每次操作必须postback回服务器 2.个性化输出数据有限(只能输出HTML表格) 使用范围:主要用在含有数据的表格中,一般数据源是一个Dataset。对于有排序、分页、多列显示、对性能要求不是很高选用Datagrid. Datalist 优点:1.拥有强大的模板特性,灵活性高 2.支持数据的编辑状态 3.性能优于Datagrid 缺点:1.开发周期略比Datagrid高 2.没有Datagrid编辑器 3.不容易实现分页和排序功能 使用范围:主要用于单列的数据列表、高性能的自定义数据表,每行多条记录,如电子相册(含分页) Repeat 优缺点:1.控件完全以HTML方式呈现,更加个性化 2.不支持分页、编辑和排序功能 3.开发周期最长 4.不提供默认的风格,需手工编写 5.性能最好,但特性最少 使用范围:主要用于一些灵活性、性能更高的数据展现。 Datagrid整体介绍: Datagrid类似于数据库的表格,记录集由行集(items)和列集(columns)组成,行集由多个datagridColumn组成

Access objects dynamically set / created by Templates

可紊 提交于 2020-03-25 18:59:41
问题 I began a question here, but it doesn't seem to be concise enough. I have a DataGrid Bound to an object (Job): private String resultImagePath; // The Image to be shown in the DataGrid showing the status private String name; // The Job container's name private String jobDescription; // A Sub Task // AND the corresponding Public Properties implementing iPropertyChange public int Sequence; // For sorting purposses // The paths to the icons public String ErrorPath = "pack://application:,,,

Access objects dynamically set / created by Templates

假如想象 提交于 2020-03-25 18:59:06
问题 I began a question here, but it doesn't seem to be concise enough. I have a DataGrid Bound to an object (Job): private String resultImagePath; // The Image to be shown in the DataGrid showing the status private String name; // The Job container's name private String jobDescription; // A Sub Task // AND the corresponding Public Properties implementing iPropertyChange public int Sequence; // For sorting purposses // The paths to the icons public String ErrorPath = "pack://application:,,,

Access objects dynamically set / created by Templates

假如想象 提交于 2020-03-25 18:58:07
问题 I began a question here, but it doesn't seem to be concise enough. I have a DataGrid Bound to an object (Job): private String resultImagePath; // The Image to be shown in the DataGrid showing the status private String name; // The Job container's name private String jobDescription; // A Sub Task // AND the corresponding Public Properties implementing iPropertyChange public int Sequence; // For sorting purposses // The paths to the icons public String ErrorPath = "pack://application:,,,

DataGrid特殊行变色显示

佐手、 提交于 2020-03-25 07:25:57
在网上看了一下,基本上全是DataGridview的特殊行变色显示,由于项目有点儿老,里面用的都还是1.1版本里面的DataGrid数据绑定控件,所以就着手写了一下DataGrid特殊行的变色。 // 变色 // 记录当前页的数据总条数 int i = 0 ; DataBase.Bind_DG( this .dgMsgList, strSql); // 由于DataGrid只能通过Items.Count属性取出当前页的数据总条数,而不是像DataGridView.Rows.Count取出所有的数据总条数 // j是用来数据源取的数据,i是用来改变DataGrid行的颜色 // CurrentPageIndex下标索引是从0开始的乘以PageSize每页显示多少项,例如判断第三页数据每页显示20条(2*20)从第四十条数据开始判断 // 小于总数据数,其实后来想想也可以写成j<dgMsgList.CurrentPageIndex * dgMsgList.PageSize+dgMsgList.PageSize 这样循环次数少多了 for ( int j = dgMsgList.CurrentPageIndex * dgMsgList.PageSize; j < ((DataTable)dgMsgList.DataSource).Rows.Count; j ++ ) { //

如何将DataGrid中的数据倒入到Excel (客户端)

情到浓时终转凉″ 提交于 2020-03-24 20:59:37
现在经常能碰到客户要求打印报表的问题,我们知道B/S架构下,打印一般只有两种,一种用水晶报表,一种就是将数据倒入到Excel中进行打印,相比于第一种来说,Excel的优势还是很明显的!首先,水晶报表的价钱非常昂贵,对于一个中小型软件开发公司来说,不可把那么多资金投入到购买相关的开发工具产品当中,如果选用vs.net 自带的报表,又经常难以满足客户的真正需要。如果用倒入Excel的办法,一来可以节省不小的资金,二来也可以减短开发的周期,那我们何乐而不为呢!!! 下面我举个实际的例子,以下的代码测试已通过 //在.cs 里 using System.Configuration; //须在Config中指定连接的数据库 using common_function; //声明 namespace using System.Data .SqlClient; private void Page_Load(object sender, System.EventArgs e) { if(!Page.IsPostBack) { BindGrid(); } } private void BindGrid() { string sql_str="select * from repair_now where repair_sort_id=''"; MyDataGrid.DataSource =Public

jQuery EasyUI之DataGrid使用示例

半城伤御伤魂 提交于 2020-03-23 04:31:34
jQuery EasyUI是一个轻量级的Web前端开发框架,提供了很多的现成组件帮助程序员减轻前端代码开发量,之前有个项目中就用到了其中的DataGrid。 jQuery EasyUI框架的官方主页: http://www.jeasyui.com/demo/main/index.php 。可以下载完整开发包,里面有示例代码可以参考。 由于我使用的是ASP.NET webform技术,下面我就贴出主要的代码以供参考。 在页面中首先要引用相关的css以及js文件,这样才能使用该组件。 css部分: <link href="../Js/jQueryEasyUI/theme/default/easyui.css" rel="stylesheet" type="text/css" /> <link href="../Js/jQueryEasyUI/theme/icon.css" rel="stylesheet" type="text/css" /> <link rel="stylesheet" type="text/css" href="../Css/datagrid.css" /> js部分: <script src="../Js/jQueryEasyUI/jquery-1.7.1.min.js" type="text/javascript"></script> <script src="

Easy UI 知识点以及easyui datagrid 动态生成列

有些话、适合烂在心里 提交于 2020-03-18 17:38:00
知识点记录 1.下拉框的属性设置 <input type="text" style="width: 90px;" id="DEP_CODE" name="DEP_CODE" class="list-text easyui-combogrid" data-options="panelWidth:260, idField:'GENERAL_CODE', textField:'GENERAL_CODE', url: '@Url.Content("~/Combo/getGENERALP")', method:'post', mode:'remote', editable:true, multiple:true,//是否多选 columns:[[ {field: 'ck', checkbox: true },//多选列 {field:'GENERAL_CODE',title:'Code',width:100}, {field:'GENERAL_NAME',title:'Name',width:150} ]]" /> 2.combogrid 下拉框JQ控制能否编辑 可编辑: $("#F9_BROKER_CODE").combogrid('enable'); 不可编辑: $('#F9_BROKER_CODE').combogrid('disable'); 3.Easy UI下拉框写死数据的方法

WPF DataGrid下滑动态加载数据

﹥>﹥吖頭↗ 提交于 2020-03-18 13:42:49
效果如图: 重点是判断滑动到DataGrid底端(VerticalOffset等于ScrollableHeight),则继续加载数据 private void DataGrid_ScrollChanged(object sender, ScrollChangedEventArgs e) { var scrollViewer = e.OriginalSource as ScrollViewer; if (e.VerticalOffset!=0 && e.VerticalOffset == scrollViewer.ScrollableHeight) { GenerateData(); } } 示例代码 LoadingDataAsync 参考资料 WPF ScrollViewer panning 来源: https://www.cnblogs.com/Lulus/p/12516721.html

01从DataGrid中导入到Excel

与世无争的帅哥 提交于 2020-03-18 09:58:50
01网络上有很多导出数据到Excel的方法,我在网上找到了一种比较简单实用的方法(参考了网友的方法) string fileName = ""; Microsoft.Win32.SaveFileDialog dlg = new Microsoft.Win32.SaveFileDialog(); dlg.DefaultExt = ".xls"; // Default file extension dlg.Filter = "Excel 工作簿|*.xls"; // Filter files by extension // Show save file dialog box Nullable<bool> resultDlg = dlg.ShowDialog(); // Process save file dialog box results if (resultDlg == true) { // Save document fileName = dlg.FileName; } //将DataGrid中的数据导入到excel文件中 Searchresult.SelectAllCells(); Searchresult.ClipboardCopyMode = DataGridClipboardCopyMode.IncludeHeader; ApplicationCommands.Copy