首页
学习
活动
专区
圈层
工具
发布
    • 综合排序
    • 最热优先
    • 最新优先
    时间不限
  • 来自专栏c#开发者

    锦上添花DataGrid

    我们知道如果datagrid的宽度比较长那么使得我们很难分清楚行数据,也就是很容易 使我们看错行,我想如果当我们的鼠标移动到datagrid的行上,他可以清楚的显示给 我们就好了,那么好吧现在我们就开始 ,首先我们知道datagrid在客户端被解释成了 table所以我们有知道table都有tr和td组成,tr就是行,我们只需要在每个tr上面的 onmouseover加入一段javascript脚本就可以实现这个功能 通过这个方法我们还可以添加在鼠标移动到行上出现提示的效果 e.Item.Cells[2].Attributes.Add("title","在这里可以添加提示信息"); 经过实践发现在绑定的时候你可以添加很多的javascript脚本使你的datagrid

    1.1K70发布于 2018-04-13
  • 来自专栏木子墨的前端日常

    easyUI datagrid 清空

    最近在做一个管理系统,出于一些需要,经常要将一些datagrid清空。然后easyUI本身并没有自带的方法,然后自己动手丰衣足食吧。 清空无外乎两种思路,删除现有数据和填充空数据。 1.删除数据 var rows = $(id).datagrid('getRows'); for(var i=rows.length-1;i>=0;i-- ,每次都删除第一行,删除后datagrid要重新计算index,然后两者出现了冲突导致删除不能继续。。。 使用datagrid自带的loadData方法即可 ('#dg_careersystem').datagrid('loadData',{total:0,rows:[]}) total:0舍弃也是可以的, 毕竟不是每一个datagrid都需要做分页的。

    4.1K30发布于 2018-09-13
  • 来自专栏Java架构师必看

    常见 Datagrid 错误

    有关如何在 Datagrid 中实现分页的信息,请参阅 Paging in DataGrid QuickStart Tutorial。 在每个 Datagrid 事件(Edit、Update、Cancel、Page 或 Sort)中,请确保设置了 Datagrid 的 Datasource 属性(除非已经在 <asp:Datagrid> 对 Datagrid 控件或包含 Datagrid 的页面禁用 ViewState 时,如果 Datagrid 会启动回发事件,那么需要执行一些特殊的步骤。 如果要处理以下 Datagrid 事件中的任何一部分(或全部),那么还需要在 ViewState 中手动存储一些 Datagrid 属性。 例如,在禁用了 ViewState 的 Datagrid 中进行编辑时,只要是在 Page_Load 中第一次绑定 Datagrid 之前重新存储 EditItemIndex,且 Datagrid 处于编辑模式

    3.6K20发布于 2021-03-22
  • 来自专栏听雨堂

    Repeater,DataList,DataGrid

         <FooterTemplate>             </FooterTemplate> DataList写法跟repeater类似,不过默认是列表,所以不要写头和尾 DataGrid

    1.1K90发布于 2018-01-23
  • 来自专栏个人编程笔记

    C#-DataGrid

    <DataGrid.Resources> <Style TargetType="DataGridRow"> <Setter Property="IsSelected" Value ="{Binding IsSelected}"></Setter> </Style> </DataGrid.Resources>

    99020编辑于 2023-03-18
  • 来自专栏Java架构师必看

    DataGrid列操作

    (DataColumn mDCol in dt.Columns)   {     if(mDCol.ColumnName=="aa")  {     //存在aa  }   } 怎么样移除DataGrid , Web.UI.WebControls.DataGridItemEventArgs e) {  e.Item.Cells.Remove(e.Item.Cells[0]); } 有条件地格式化DataGrid rv.Row.ItemArray[4]);   if (nUnitsInStock < 20)   {      e.Item.Cells[4].BackColor = Color.Red;   }  } } DataGrid 列宽度设置 浏览状态下的列宽度可以这样设置: Column.ItemStyle.Width = 100; 编辑状态下的列宽度可以这样设置: private void DataGrid1_EditCommand

    1.6K30发布于 2021-03-22
  • 来自专栏Java架构师必看

    DataGrid鼠标事件处理

    完成功能是DataGrid的页面选中事件、鼠标事件、双击事件改变TR的色彩。代码很简单,只是一点JS操作。 JS文件:GridControl.js ============================= /*------------ DataGrid鼠标事件处理 ------------ 功能:用于数据梆定后鼠标事件

    2.4K20发布于 2021-03-22
  • 来自专栏

    Flex 打印DataGrid内容

    -- Custom control to print the DataGrid control on multiple pages. --> <mx:VBox xmlns:mx="http://www.adobe.com footer.includeInLayout=true;                     footer.visible = true;                 }                 //Update the <em>DataGrid</em>

    1.3K40发布于 2018-09-12
  • 来自专栏全栈程序员必看

    DataGrid1_ItemDataBound

    DataGrid1; protected string conn=test.conn; private void Page_Load(object sender, System.EventArgs (this.DataGrid1_CancelCommand); this.DataGrid1.EditCommand += new System.Web.UI.WebControls.DataGridCommandEventHandler (this.DataGrid1_EditCommand_1); this.DataGrid1.UpdateCommand += new System.Web.UI.WebControls.DataGridCommandEventHandler (this.DataGrid1_UpdateCommand); this.DataGrid1.ItemDataBound += new System.Web.UI.WebControls.DataGridItemEventHandler e) { DataGrid1.EditItemIndex=-1; bind(); } } } 版权声明:本文内容由互联网用户自发贡献,该文观点仅代表作者本人。

    87930编辑于 2022-11-04
  • 来自专栏Java架构师必看

    DataGrid鼠标事件方法

    id+",";   Rows[i].style.color=setSelectColor;  } } =========================================== 后台DataGrid

    1.6K20发布于 2021-03-22
  • 来自专栏全栈程序员必看

    grid web_DataGrid

    首先安装Infragistics.NetAdvantage.for.ASP.NET.2007.Vol.2,然后在选择项中添加UltraWebGrid,使用方法如下: 1、添加“总计”值 绑定完数据后,添加如下代码 UltraWebGrid1.Rows.Add(); UltraWebGrid1.Rows.Add(); UltraWebGrid1.Rows[UltraWebGrid1.Rows.Count – 1].Cells[0].Text = “小计”; //倒数第一行 UltraWebGrid1.Rows[UltraWebGrid1.Rows.Count – 2].Cells[0].Text = “总计”; double sum = 0; string strtemp = string.Empty; for (int i = 0; i < UltraWebGrid1.Rows.Count – 1; i++) { if (UltraWebGrid1.Rows[i].Cells[2].Value != null) { strtemp = UltraWebGrid1.Rows[i].Cells[2].Value.ToString(); sum += Convert.ToDouble(strtemp); } } UltraWebGrid1.Rows[UltraWebGrid1.Rows.Count – 1].Cells[2].Value = sum; 2、单击单元格选中行 (1) 选择UltraWebGrid-displayout–>CellClickActionDefault=RowSelected (2) 选择UltraWebGrid—displayout–>SelectedRowStyleDefault的BackColor属性,设置颜色。 3、显示自动列号 RowSelectorsDefault=”Yes” AllowRowNumberingDefault=”ByDataIsland” 4、隐藏一列 UltraWebGrid1.Columns[i].Hidden=true; 5、添加模板列 (即在绑定数据外,添加的列):先选择UltraWebGrid –属性–columns–勾选Templated column 即可。 6、增加Checkbox 第一种方法:在表格的InitializeRow事件中添加如下代码 if (e.Row.Band.Index == 0) { string str = string.Empty; str = “<input id=’chk” + e.Row.Index + “‘ type=’checkbox’ name=’chkName” + e.Row.Index + ” ‘ />”; e.Row.Cells[0].Text = str; } 第二种方法: 绑定数据后,添加 GridTake.Columns[0].Type = ColumnType.CheckBox; //设定第0列的数据类型 GridTake.Columns[0].AllowUpdate = AllowUpdate.Yes;//设置checkbox是否可用。 GridTake.Columns.FromKey(“CHK”).Type= ColumnType.CheckBox; GridTake.Columns.FromKey(“CHK”).AllowUpdate = AllowUpdate.Yes; for (int i = 0; i < GridTake.Rows.Count; i++) { GridTake.Rows[i].Cells[0].Value = false; //初始化checkbox } //全选checkbox protected void cbCheckAll_CheckedChanged(object sender, EventArgs e) { if (cbCheckAll.Checked) { for (int i = 0; i < GridTake.Rows.Count; i++) { GridTake.Rows[i].Cells[0].Value = true; } } else { for (int i = 0; i < GridTake.Rows.Count; i++) { GridTake.Rows[i].Cells[0].Value = false; } }

    78430编辑于 2022-11-08
  • 来自专栏随想

    Angular DataGrid组件开发

    完成的效果: image.png 组件的目录结构: image.png DataGrid组件的结构非常简单,仅需要一个组件即可完成。 DataGrid组件: 先放下代码:

    <div /dataGrid.component.html', styleUrls: ['. 在其他页面中使用DataGrid组件:
    <app-dataGrid [data]="data image.png 这样一个简单的DataGrid组件就完成了。 当然后续还可以增加内置的搜索功能,PageSize选择功能。 现在是使用客户端分页,同样可以增加服务端分页的功能。

    1.6K30发布于 2021-04-04
  • 来自专栏全栈程序员必看

    DataGrid的ItemDataBound事件

    DataGrid之ItemCommand事件 如下代码是将 e.Item.Cells[3].Text;的值传个下一个跳出的页面,这个格式要 记住它支持ItemCommand事件,给DataGrid添加这个事件的方法是 private void DataGrid2_ItemCommand(object source, System.Web.UI.WebControls.DataGridCommandEventArgs id="+e.Item.Cells[3].Text; myData.openwin(strUrl,"600","480",this.Page); break; } } }  当项被数据绑定到 DataGrid 利用DataGrid的ItemDataBound事件,我们可以轻松实现一些实用的功能。 private void DataGrid1_ItemDataBound(object sender, DataGridItemEventArgs e) { if (e.Item.ItemType

    71440编辑于 2022-09-06
  • 来自专栏个人编程笔记

    C#-datagrid使用

    浏览量 2 datagrid是开发中常用的一个数据展示控件,主要用来展示表格数据。 "> <DataGrid.Columns> <DataGridTextColumn Header="Name" Binding="{Binding > </<em>DataGrid</em>> 通过表格值改变行颜色 我们可以通过转换器IValueConverter 或者IMultiValueConverter获取到数据,然后根据你想要的条件进行颜色值的返回。 控件上启用拖拽,并添加事件 AllowDrop="True" PreviewMouseMove="<em>dataGrid</em>_PreviewMouseMove" Drop="<em>dataGrid</em>_Drop"、 //事件实现 e.LeftButton == MouseButtonState.Pressed) { DataGrid dataGrid = sender as DataGrid

    1.3K00编辑于 2023-03-03
  • 来自专栏葡萄城控件技术团队

    深入解析 DataGrid 过滤功能

    过滤是DataGrid这样的表格控件的基本功能之一,也是非常重要的特性。微软提供的标准DataGrid相信大家都很熟悉了。 本文要解析的不是标准DataGrid,而是Silverlight和WPF平台下的C1DataGrid的过滤功能。 <c1:C1DataGrid Name="c1DataGrid1" CanUserFilter="True" FrozenTopRowsCount="1" RowHeight="30"> <c1:C1DataGrid.TopRows <c1:C1DataGrid Name="c1DataGrid1" AutoGenerateColumns="False" CanUserFilter="True"> <c1:C1DataGrid.Columns </c1:C1DataGrid.Columns> </c1:C1DataGrid> 通过代码设置过滤功能 有些情况下,需要在代码中控制过滤功能,C1DataGrid为此提供了两个非常重要的事件。

    3.7K70发布于 2018-01-10
  • 来自专栏Java架构师必看

    捕捉DataGrid的双击事件

    )(this.dataGrid1)).BeginInit(); this.SuspendLayout(); // // dataGrid1 // this.dataGrid1.CaptionBackColor ; this.dataGrid1.CaptionVisible = false; this.dataGrid1.DataMember = ""; this.dataGrid1.HeaderForeColor ; this.dataGrid1.Name = "dataGrid1"; this.dataGrid1.Size = new System.Drawing.Size(368, 144); this.dataGrid1 .TabIndex = 0; this.dataGrid1.MouseDown += new System.Windows.Forms.MouseEventHandler(this.dataGrid1_ = DateTime.Now; label1.Text = "DataGrid1 鼠标按下了。

    2.2K40发布于 2021-03-22
  • 来自专栏c#开发者

    datagrid资料+ by iCeSnaker - Program rhapsody

    datagrid资料+ by iCeSnaker - Program rhapsody 关于datagrid的打印 http://www.chinaaspx.com/article/csharp/295 .htm C#中为DataGrid添加下拉列表框 http://www.cnblogs.com/icesnaker/archive/2004/09/21/45015.aspx DataGrid也玩分页 .shtm DataGrid删除确认及Item颜色交替 http://dev.csdn.net/develop/article/26/26768.shtm DataGrid常见解决方案(三)--在DataGrid /26/26589.shtm 怎样使用DataGrid控件 http://dev.csdn.net/develop/article/26/26459.shtm DataGrid Web控件深度历险( .shtm 锦上添花DataGrid

    3.5K90发布于 2018-04-13
  • 来自专栏Java架构师必看

    鼠标移动,改变DataGrid颜色

    Sub DataGrid1_ItemDataBound(ByVal sender As Object, ByVal e As System.Web.UI.WebControls.DataGridItemEventArgs --------------------------------          ' Add the OnMouseOver and OnMouseOut method to the Row of DataGrid ---------------------------          ' Add the OnMouseOver and OnMouseOut method a Cell (Column) of DataGrid -------------------------------          ' Change the Mouse Cursor of a particular Cell (Column) of DataGrid          ' (Or you may do it for a whole Row of DataGrid ?         

    3K20发布于 2021-03-22
  • 来自专栏林德熙的博客

    win10 uwp dataGrid Microsoft.Toolkit.Uwp.UI.Controls.DataGrid表格控件

    本文告诉大家如何在 UWP 使用 DataGrid ,提供两个方法使用。 Microsoft.Toolkit.Uwp.UI.Controls.DataGrid 这是比较推荐的库,使用也很简单 安装 首先需要通过 Nuget 搜索 Microsoft.Toolkit.Uwp.UI.Controls.DataGrid <controls:DataGrid x:Name="DataGrid" Margin="100,10,10,10" > </controls:DataGrid> 这时就可以尝试按 local:Foo}"> </controls:DataGrid> 然后在使用 DataGridTextColumn 写出一行 <controls:DataGrid x > </controls:DataGrid> ?

    3.3K10发布于 2018-09-18
  • 来自专栏令仔很忙

    EasyUI----DataGrid 导出 Excel

    最近做的安防项目有个功能,需要把DataGrid中的数据导出,下面通过代码一步一步的介绍; 首先在js中写一个扩展类,主要的功能是把DataGrid中的数据转换成Excel的XML格式 '''将datagrid 中的数据转换成Excel的XML格式''' $.extend($.fn.datagrid.methods, { getExcelXml: function (jq, param) { var worksheet = this.createWorksheet(jq, param); //alert($(jq).datagrid('getColumnFields')); var totalWidth = 0; var cfs = $(jq).datagrid('getColumnFields'); for (var i = ('getExcelXml', { title: 'datagrid import to excel' }); '''获取datagrid数据对应的excel需要的xml格式的内容''' '''

    3K10发布于 2018-09-14
领券