datagrid

Binding to DataGridColumn with IMultiValueConverter encounters issues while using a similiar IValueConverter does not

假如想象 提交于 2019-12-24 06:45:02
问题 I have 2 Datagrid checkbox columns each with a binding. <DataGrid ItemsSource="{Binding}" Name="DataGrid1" DataContext="{Binding Source={StaticResource TableViewSource}}"> <DataGridCheckBoxColumn Header="Required" Width="50" MinWidth="50"> <DataGridCheckBoxColumn.Binding> <Binding Path="Required" Converter="{StaticResource DateTimeToBooleanConverter}"/> </DataGridCheckBoxColumn.Binding> </DataGridCheckBoxColumn> <DataGridCheckBoxColumn Header="Required Test" Width="60" MinWidth="60">

How can I change the properties of a DataGridTemplateColumn DataTemplate Element for a specific cell

和自甴很熟 提交于 2019-12-24 06:44:09
问题 I have a problem with my DataGrid I created a while ago. The DataGrid shows informations about project tasks. Now I have to make the start- and end-date column editable. For this purpose I changed the DataGridTextColumn with the following code: <DataGridTemplateColumn Header="Start" Width="100" CanUserReorder="True"> <DataGridTemplateColumn.CellTemplate> <DataTemplate> <DatePicker x:Name="DpStartDate" SelectedDate="{Binding PlannedStart, StringFormat=\{0:dd.MM.yyyy\}}" IsEnabled="False"/> <

Set ForeColor & BackgroundColor of each Column For Each Row Separately in .Net Compact Framework 3.5

﹥>﹥吖頭↗ 提交于 2019-12-24 06:38:05
问题 I am developing a Window CE 5 Program With Visual Studio 2008. By using a DataGrid Control in one of my forms, I need to change each row background and forecolor depending on some conditions. for doing this, I use this class: public class ColoredDataGridTextBoxColumn : DataGridTextBoxColumn { public Color BackgroundColor { get; set; } public Color ForeColor { get; set; } public ColoredDataGridTextBoxColumn() { BackgroundColor = Color.White; ForeColor = Color.Black; } protected override void

Asp.Net下导出/导入规则的Excel(.xls)文档

独自空忆成欢 提交于 2019-12-24 06:15:07
datatable中的数据导出excel文档 /// <summary> /// 将datatable中的数据导出到指定的excel文档中 /// </summary> /// <param name="page">web页面对象</param> /// <param name="tab">包含被导出数据的datatable对象</param> /// <param name="filename">excel文档的名称</param> public static void export(system.web.ui.page page,system.data.datatable tab,string filename) { system.web.httpresponse httpresponse = page.response; system.web.ui.webcontrols.datagrid datagrid=new system.web.ui.webcontrols.datagrid(); datagrid.datasource=tab.defaultview; datagrid.allowpaging = false; datagrid.headerstyle.backcolor = system.drawing.color.green; datagrid

Vb6 Record Updation Error

爱⌒轻易说出口 提交于 2019-12-24 05:49:48
问题 In vb6, a form containing following values and here is the screenshot link for the sample values ! And I am using Ms Access 2007 and it contains a table named "studentexamdetail" contains heading(Admno,Semester,Subjectcode,Regular_Arrear,Fee) And my doubt is when i click "Save" button in above form(see screenshot), then admission number,semester,all the subjectcode, regular_arrear(we can write manually) and Fee should saved in the "studentexamdetail" table but it stores 1st value only when i

How to Change DataGrid ItemsSource Without Freezing the UI Thread?

耗尽温柔 提交于 2019-12-24 05:14:12
问题 I have a list of Customers and I update my DataGrid 's ItemsSource to contain the customers list. The problem is that after changing the ItemsSource , the thread update all binding targets to the values in each customer object, and this action freezes the UI for more than 30 seconds. To solve this I tried to change the ItemsSource property in another Thread but the new thread can not access the datagrid control which owned by the UI thread. If I put the ItemsSource changing code in Invoke

How to Change DataGrid ItemsSource Without Freezing the UI Thread?

蹲街弑〆低调 提交于 2019-12-24 05:14:09
问题 I have a list of Customers and I update my DataGrid 's ItemsSource to contain the customers list. The problem is that after changing the ItemsSource , the thread update all binding targets to the values in each customer object, and this action freezes the UI for more than 30 seconds. To solve this I tried to change the ItemsSource property in another Thread but the new thread can not access the datagrid control which owned by the UI thread. If I put the ItemsSource changing code in Invoke

Set Display format for winform DataGridView

二次信任 提交于 2019-12-24 04:40:24
问题 I am new to WinForms development, currently I am maintaining an application developed in .Net 2.0 In the application, I have grid with column called Length which displays the value with unit. I have used CellFormatting event to format the cell value, otherwise it is just number. But when user start editing I wouldn't want unit to be displayed, user should be allowed enter only numbers. Is there any straight forward way to do it? Events or Properties to be set on the grid? 回答1: You should set

How to make cell to take full width when aligned to right or left in WPF grid

梦想与她 提交于 2019-12-24 04:38:13
问题 I'm designing some grid in WPF and want to display numbers aligned to right, but when I set HorizontalAlignment=Right the cell itself don't use all available width, so the border is painted half based on content. Look at the attached picture. The code is: <Grid Width="620" Name="tblTaxBalance"> <Grid.ColumnDefinitions> <ColumnDefinition Width="110"/> <ColumnDefinition Width="350"/> <ColumnDefinition Width="80" Style="{StaticResource CellRightAlign}"/> <ColumnDefinition Width="80" Style="

DataGrid not scrolling smoothly

喜你入骨 提交于 2019-12-24 04:25:19
问题 I have a DataGrid which usually contains approx 30 rows it rarely goes above 200. My problem is when the user goes through the contents of the grid with the up/down arrow keys it keeps getting stuck(approx 10 to 40 seconds) and then jumping several rows at a time My DataGrid <DataGrid Name="DgInvoiceLines" KeyUp="DgInvoiceLines_KeyUp" BorderBrush="Black" RowBackground="Silver" HorizontalScrollBarVisibility="Visible" VerticalScrollBarVisibility="Visible" AutoGenerateColumns="False"