DataGrid列自定义显示(模板)
定义模板列:
<sdk:DataGrid>
<sdk:DataGrid.Columns>
<sdk:DataGridTemplateColumn Header="xxx" Width="Auto" IsReadOnly="True">
<sdk:DataGridTemplateColumn.CellTemplate>
<DataTemplate>
<TextBlock FontSize="11" VerticalAlignment="Center" Margin="4,0,0,0"></TextBlock>
</DataTemplate>
</sdk:DataGridTemplateColumn.CellTemplate>
</sdk:DataGridTemplateColumn>
</sdk:DataGrid.Columns>
</sdk:DataGrid>
在DataGrid的LoadingRow事件中自定义显示数据
private void dataGrid1_LoadingRow(object sender, DataGridRowEventArgs e)
{
int idx = e.Row.GetIndex();
TextBlock cell = dataGrid1.Columns[0 ].GetCellContent(e.Row) as TextBlock;
// 比如:行号。
cell.Text = (idx+1).ToString() ;
}
DataGrid列自定义显示(模板)相关推荐
- antd表格列自定义显示与隐藏
效果图: 相关定义: ckValues: [], //checkgroup设置值chkAll: true, //全选indeterminate: false, //模糊状态poped: false / ...
- easyui 隐藏input_easyui datagrid 列显示和隐藏
//当查询IT基础设施的时候隐藏'STAFF_ID'.'ITSM_STAFF_ID' if($("input[name='currentstate']").val()==2){ $ ...
- ASP.NET MVC 3 - 部分vs显示模板与编辑器模板
本文翻译自:ASP.NET MVC 3 - Partial vs Display Template vs Editor Template So, the title should speak for ...
- 怎样让WinForms下DataGrid可以像ASP.NET下的DataGrid一样使用自定义的模板列
昨天被问到一个问题:怎么把WinForms里的DataGrid的绑定了数据库bit字段的列默认显示的CheckBox换成"男"和"女",也就是说怎么样像ASP. ...
- 为 ASP.NET Datagrid 创建自定义列
Marcie Robillard DatagridGirl.com 2003 年 9 月 简介 不得不承认,为 Microsoft® ASP.NET 编写 Datagrid 代码包括大量的重复工作.尽 ...
- SharePoint 2013 关于自定义显示列表表单的bug
1.在SharePoint 2013中,我们隐藏列表Dispform页面的ListFormWebPart部件,转而使用自定义显示列表表单进行展示,因为这样更容易定制我们需要的显示: 2.之后发现文件夹 ...
- easyui datagrid 列隐藏和显示
easyui datagrid 列隐藏和显示 用js怎么控制列的显示和隐藏? 最佳答案 $('#grid').datagrid('hideColumn','列field');把hideColumn换成 ...
- iview(View UI)使用 Vue 的 Render 函数,自定义表格列头显示内容(renderHeader)
开发中遇到这样一个需求,该项目用的是iview UI组件,需求是: 表格列头有一个字段和一个单位,两者样式不同,理想效果如下:"建筑面积四个字为18px.单位(㎡)为16px". ...
- 1.怎样定制VC#DataGrid列标题?
1.怎样定制VC#DataGrid列标题? DataGridTableStyle dgts = new DataGridTableStyle(); dgts.MappingName = "m ...
最新文章
- Struts2--ActionContext及CleanUP Filter
- JauntVR中文版登陆小米商店,首波内容有《五十度黑》
- android组建之间通信_Android各组件/控件间通信利器之EventBus
- 在Java中调用与系统有关的剪切板Clipboard
- 阿里AI智能音箱现在有了视觉能力,跟人交互时表情丰富
- 从零基础入门Tensorflow2.0 ----二、5.2实战sklearn封装keras模型(超参数搜索)
- python 万年历代码
- [Asp.Net Core]Session的使用
- ad转3d视图快捷键_AD详细快捷键按键
- 行业知识图谱调查报告(一):知识图谱概述
- 戴尔微型计算机怎么换硬盘,教你如何给DELL台式电脑换硬盘
- JavaScript 导出 table 为 Excel 表格
- 3D模型欣赏:人形武器 古代兵器 【3D游戏建模教程】
- 常用的行列式和矩阵的性质
- AD设计PCB新手入门
- 半加器——Verilog HDL语言
- 从零开始学前端 - 1. HTML基础知识
- openNI驱动控制kinect马达
- 云计算或成时代新拐点?从哪些点可以看出?
- board/freescale/mx6ull_alientek_emmc/Kconfig:15: ‘endif‘ in different file than ‘if‘