datagrid

ASP.NET 2.0 - DataGrid with tbody / thead

て烟熏妆下的殇ゞ 提交于 2020-01-01 09:59:22
问题 Is there a way to get the DataGrid control to render the tbody and thead HTML elements? 回答1: While I like the answer by "user186197", that blog post uses reflection, things might go wrong in non-full-trusted hosting environments. Here's what we use, no hacks: public class THeadDataGrid : System.Web.UI.WebControls.DataGrid { protected override void OnPreRender(EventArgs e) { this.UseAccessibleHeader = true; //to make sure we render TH, not TD Table table = Controls[0] as Table; if (table !=

Paste from Excel to WPF DataGrid

最后都变了- 提交于 2020-01-01 08:12:08
问题 I have a DataGrid (called TheGrid) that I would like to implement copy and paste functionality on. The copy functionality works great but I don't know how to implement paste. Do I just need to get the data from the clipboard and parse myself? The command bindings: <Window.CommandBindings> <CommandBinding Command="Copy" Executed="CommandBinding_Executed" CanExecute="CommandBinding_CanExecute" /> <CommandBinding Command="Paste" Executed="CommandBinding_Executed" CanExecute="CommandBinding

How do I detect row selection in the Xceed DataGrid for WPF

时间秒杀一切 提交于 2020-01-01 07:27:10
问题 I'm horrible at this WPF thing, so bear with me. I'm using the Xceed DataGrid for WPF, and I need to know when someone selects a row, but I can't figure out how to do it. I'm sure I need to add some XAML to enable this, but I can't figure out what I should do. 回答1: I use a MVVM approach and therefor favor data binding. I will bind the SelectedItem property to a SelectedItem property on my ViewModel object for the grid. <xcdg:DataGridControl x:Name="grid" SelectedItem="{Binding SelectedItem}">

display images in datagrid with Compact Framework

走远了吗. 提交于 2020-01-01 06:55:35
问题 is it possible to display an image in a datagrid cell? i'm currently working with compact framework 3.5. any tips on that? 回答1: Like the other posters have commented, you're required to roll your own. Luckily, this isn't too difficult. In my application, I needed a way to draw a 16x16 icon in a particular column. I created a new class that inherits from DataGridColumnStyle , which makes it easy to apply to a DataGrid via a DataGridTableStyle object. class DataGridIconColumn :

easyui datagrid 表格适应屏幕

我的梦境 提交于 2020-01-01 00:10:53
1.项目后台系统使用easyui,datagrid 的数据设置为自动适应屏幕,那么对于笔记本的话,就会显得有的小,可以通过设置datagrid属性,进行固定长度的设置 $('#gridTable').datagrid( { idField : 'id', // 只要创建数据表格 就必须要加 ifField title : title, fit : true, url : top.baseUrl+ 'customer/bail/allBailPayDetailsQuery', method : 'POST', fitColumns : true, nowrap : false, striped : true, // 隔行变色特性S loadMsg : '数据正在加载,请耐心的等待...', rownumbers : true, 这样设置,每一列都会按照,比例进行显示。 2.另一种方式 $('#gridTable').datagrid( { idField : 'id', // 只要创建数据表格 就必须要加 ifField title : title, fit : true, url : top.baseUrl+ 'customer/bail/allBailPayDetailsQuery', method : 'POST', fitColumns : false, nowrap :

【开源】OSharp框架解说系列(2.1):EasyUI的后台界面搭建及极致重构

落花浮王杯 提交于 2019-12-31 23:22:29
OSharp是什么?   OSharp是个快速开发框架,但不是一个大而全的包罗万象的框架,严格的说,OSharp中什么都没有实现。与其他大而全的框架最大的不同点,就是OSharp只做抽象封装,不做实现。依赖注入、ORM、对象映射、日志、缓存等等功能,都只定义了一套最基础最通用的抽象封装,提供了一套统一的API、约定与规则,并定义了部分执行流程,主要是让项目在一定的规范下进行开发。所有的功能实现端,都是通过现有的成熟的第三方组件来实现的,除了EntityFramework之外,所有的第三方实现都可以轻松的替换成另一种第三方实现,OSharp框架正是要起隔离作用,保证这种变更不会对业务代码造成影响,使用统一的API来进行业务实现,解除与第三方实现的耦合,保持业务代码的规范与稳定。 本文已同步到系列目录: OSharp快速开发框架解说系列 前言   要了解一个东西长什么样,至少得让我们能看到,才能提出针对性的见解。所以,为了言之有物,而不是凭空漫谈,我们先从UI说起,后台管理页面的UI我们将使用应用比较普遍的easyui框架。   以前在用easyui的时候,每个页面都得从0做起,或者不厌其烦地由以前的页面通过“复制-粘贴”的方式来修改,久页久之,就会造成页面庞大且难以维护。其实,前端的html,javascript代码与后端的代码是一样的,通过一定的组织,把重复的代码抽离出来

Columns are collapsed when using group in datagrid

此生再无相见时 提交于 2019-12-31 10:00:08
问题 I have a datagrid in which I display several objects with some columns. I added grouping to the datagrid and now it seems that it doens't like the colulmns with width of '*' - the columns are all collapsed to their minimum widths. However, when I refresh the grid (after adding an element or modifiying an existing one), I can see the columns refreshing alright. The weird thing is that I call the same function twice and the first time it doesn't work while the second it does. Before : http:/

How to get a WPF DataGrid cell to right align without making the selectable area on a new row tiny?

送分小仙女□ 提交于 2019-12-31 08:53:33
问题 I'm using a WPF4.0 DataGrid. When double clicking on a cell in a new row everything works fine unless I've added a cell style to that column. For example, I have a numeric column where I want the data right aligned so the xaml looks like this <DataGridTextColumn Binding="{Binding Path=ImpaId}" CellStyle="{StaticResource CellRightAlign}"> <DataGridTextColumn.Header> <TextBlock Style="{StaticResource DataGridHeader}">Impa</TextBlock> </DataGridTextColumn.Header> </DataGridTextColumn> Where the

How to get a WPF DataGrid cell to right align without making the selectable area on a new row tiny?

夙愿已清 提交于 2019-12-31 08:53:26
问题 I'm using a WPF4.0 DataGrid. When double clicking on a cell in a new row everything works fine unless I've added a cell style to that column. For example, I have a numeric column where I want the data right aligned so the xaml looks like this <DataGridTextColumn Binding="{Binding Path=ImpaId}" CellStyle="{StaticResource CellRightAlign}"> <DataGridTextColumn.Header> <TextBlock Style="{StaticResource DataGridHeader}">Impa</TextBlock> </DataGridTextColumn.Header> </DataGridTextColumn> Where the

Displaying selected values only in VB6

左心房为你撑大大i 提交于 2019-12-31 07:31:27
问题 I am trying to display students in a datagrid that have "yes" as active. If the student has "no" as active, the form has to hide it and only show the students with "yes". The problem that I am recieving now is Syntax error in FROM clause. code: Private Sub Form_Load() Dim sql As String connSearch.Open connstr Adodc1.ConnectionString = conn.connstr sql = "select * from Table1 where Active <>" & "'No'" Adodc1.RecordSource = sql Set StudentTable.DataSource = Adodc1 Adodc1.Refresh Adodc1.Visible