datagrid

【前端】jQuery DataTables 使用手册(精简版)

て烟熏妆下的殇ゞ 提交于 2020-01-07 12:37:46
本文转载自: https://www.cnblogs.com/shamoyuu/p/5182940.html 作者:shamoyuu 转载请注明该声明。 转载请注明出处: http://www.cnblogs.com/shamoyuu/p/5182940.html 前排提醒,这个插件能不用就不用,那么多好的插件等着你,为什么要用它呢?就算用easyui的datagrid然后自己改样式都比这强得多。 在引入easyui的css后,引入下面的css,就可以把easyui的datagrid变成bootstrap的风格了。 /* =================== easyui datagrid begin ======================= */ .datagrid-row:nth-child(odd) { background : #F0F0F0 ; } .datagrid-header td, .datagrid-body td, .datagrid-footer td { border-style : solid ; } .datagrid-row, .datagrid-header-row { height : 40px ; } .datagrid-header, .datagrid-td-rownumber { background : #FFF ; }

Accessing items in ObservableCollection bound to WPF DataGrid

帅比萌擦擦* 提交于 2020-01-07 09:35:07
问题 I have an ObservableCollection bound to a WPF DataGrid in which MyClass has a Boolean flag indicating if item has been seen or not. If the item in the DataGrid is selected I want to set the MyClass.Seen property to true to indicate that it was viewed. Initially, the SelectedIndex of the DataGrid matches to the index of the ObservableCollection but if I ever sort the DataGrid using any of the various columns that it displays, the SelectedIndex no longer matches with the ObservableCollection.

How add row to DataGrid?

半腔热情 提交于 2020-01-07 07:56:09
问题 I have small program for edit XML-files. I using XMLDataProvider: <Grid.DataContext> <XmlDataProvider x:Name="XMLData" Source="/database/stroyka1.bas" XPath="JobArray/job"/> </Grid.DataContext> and DataGrid: <DataGrid Name="JobsDataGrid" ItemsSource="{Binding}" AutoGenerateColumns="false" Height="Auto" Width="Auto" IsReadOnly="False" CanUserAddRows="True"> <DataGrid.Columns> <DataGridTextColumn Header="ID" Binding="{Binding XPath=id, Mode=TwoWay}" /> <DataGridTextColumn Header="Название"

How to stop DataGrid row color from changing?

放肆的年华 提交于 2020-01-07 06:43:31
问题 I've implemented code to get around the double click issue when selecting a row in a WPF DataGrid. I'm using the following code from here: https://stackoverflow.com/a/5857908/40106. <Style TargetType="DataGridCell"> <Style.Triggers> <Trigger Property="IsMouseOver" Value="True"> <Setter Property="IsEditing" Value="True" /> </Trigger> </Style.Triggers> </Style> Rows have alternating colors. The problem is when I mouse over a row, in one column, the light blue color is replaced by white. The

Cannot resolve property 'myObservableCollection' in data context of type ''namespace.class"

隐身守侯 提交于 2020-01-07 05:06:24
问题 I have a class called Stockage which inherit of INotifyPropertyChanged. this class set some strings and then create an ObservableCollection of ObservableCollections. This ObservableCollection send values to the several strings set before. Like this: public class Stockage:INotifyPropertyChanged { public string Flag { get; set; } public string GroupeAlerte { get; set; } public string Pmid { get; set; } public string LibellePmrq { get; set; } public string Ligne { get; set; } public string Otm {

WPF Application - can't display data from a list in a datagrid

前提是你 提交于 2020-01-07 04:51:09
问题 I'm a newbie with WPF and c# and have a (probably very simple) problem. I'm coding a small application, and i'm trying to read data from a database, format it into a list, and display in a datagrid. Ive debugged it, and it I've successfully read the database, and all the data is in the list ( cd_list ), but it's not passing the data to the datagrid. Below is my XAML : <DataGrid Name="DataGrid" AutoGenerateColumns="false" RowHeaderWidth="0" Width="240" > <DataGrid.Columns> <DataGridTextColumn

Binding WPF DataGrid ItemsSource creates memory leak

ぃ、小莉子 提交于 2020-01-07 04:25:09
问题 I'm simply creating a Observable collection in Background and binding to it. All objects inherit from INotifyPropertyChanged. but nevertheless the Memory consumption is continuously raising. The following Objects instances are continuously raising WeakReference FrugalObjectList<WeakEventManager+Listener> ConditionalWeakTable<TKey, TValue>+Entry<Object, Object>[] WeakEventTable+EventKey ConditionalWeakTable<Object, Object> SingleItemList<WeakEventManager+Listener> Object Int32[]

Selected item not displayed in the DataGridComboBoxColumn

谁说我不能喝 提交于 2020-01-07 04:16:05
问题 I have a DataGrid with two DataGridComboBoxColumn s set in the XAML (copied from here): <DataGrid x:Name="joinGrid" AutoGenerateColumns="False" CanUserAddRows="True"> <DataGrid.Columns> <DataGridComboBoxColumn> <DataGridComboBoxColumn.ElementStyle> <Style TargetType="ComboBox"> <Setter Property="IsDropDownOpen" Value="True" /> <Setter Property="ItemsSource" Value="{Binding Path=TableAColumns}" /> <Setter Property="ItemTemplate"> <Setter.Value> <DataTemplate> <TextBlock Text="{Binding}"><

vb.net : Error Collecting data from JSON to a datagrid from a different form/ thread

纵然是瞬间 提交于 2020-01-07 03:56:18
问题 I want to retrive data from JSON api and do other task while it's loading. I have written successful code in a form Module Public Sub aquiredata(mygrid As DataGridView, sql As String, tablename As String) Dim table As DataTable Dim thread1 As New Thread( Sub() Try Dim json As String = New System.Net.WebClient().DownloadString("http://ratnt.com/api.php/" & _ tablename & "?query=" & Chr(34) & sql & Chr(34) & "&token=" & My.Settings.token) ' table = JsonConvert.DeserializeObject(Of DataTable)

OnEvent datagrid column add fail

吃可爱长大的小学妹 提交于 2020-01-07 03:43:07
问题 I have a datagrid. I want to add columns as a result of an event. So I do for (int iii = 1; iii <= 4; ++iii) { var dtgColumn = new DataGridTextColumn(); dtgColumn.Header = "AAA" Dispatcher.Invoke((Action)(() => { dtgResults.Columns.Add(dtgColumn); })); } But despite using a dispatcher I get this error: The calling thread cannot access this object because a different thread owns it. Thank you for any help Patrick } 回答1: It looks like a problem not a UI control itself, but dtgColumn object