datagrid

Databinding ObservableCollection<T> to Datagrid not working

强颜欢笑 提交于 2020-01-16 02:54:16
问题 Update Now I think I have narrowed the problem. I created single class public class OptionStrike { public OptionStrike(double p1, double p2, int p3) { // TODO: Complete member initialization P_OI = p1; StrikePrice = p2; P_Volume = p3; } public OptionStrike() { // TODO: Complete member initialization } public double P_OI { get; set; } public double P_Volume { get; set; } public double StrikePrice { get; set; } } Now, if i load the values to this OptionStrike as private void Test(object obj) {

Datagrid header sort error bound to dataview

大城市里の小女人 提交于 2020-01-15 13:33:32
问题 I'm having a problem and believe something simple, just can't get a grip on it. I have a View model for my data context of the window. On it I have a private "DataTable" that is populated from a database query. No problem. I have a public DataView property {get;set;} that returns the DataTable.DefaultView. I bind the DataGrid on the form to the path of the DataView property on the view model and run the form. No problem, comes up, columns displayed properly, click on the rows, no problem. Now

Read Text From TextBox in DataGrid MVVM (wpf databinding)

吃可爱长大的小学妹 提交于 2020-01-15 12:34:29
问题 I have a datagrid of rows which contain data read from a web server and values I want to write into a webserver. I write the values in getting the user to input a number into the appropriate column and click an adjacent text box; <DataGrid x:Name="datagridDERControl" HorizontalAlignment="Center" VerticalAlignment="Center" Background="#FF322D2D" Height="382" Margin="10,78,10,10" Width="972" ItemsSource="{Binding Path=NFDataSource, Mode=TwoWay, UpdateSourceTrigger=PropertyChanged}"> <DataGrid

DataGridTextColumn CharacterCasing in DataGrid

谁说我不能喝 提交于 2020-01-15 12:24:28
问题 I'm trying to get a DataGridTextColumn to only allow upper casing. The obvious approach would be to set CharacterCasing to Upper for the EditingElementStyle TextBox . This works great as long as you enter edit mode before starting to type but if you start typing when the cell isn't in edit mode then the first character entered in the TextBox is lower case (after this, when the cell has entered edit mode, everything works as expected). I have a feeling this is a bug or am I missing something

Dynamically add row to GridView / DataGrid / Repeater?

半城伤御伤魂 提交于 2020-01-15 11:43:22
问题 I want to create a "table" that the user will complete which has an unknown number of rows. To illustrate it, let's say it is to enter details from a receipt after a shopping trip - i.e. the number of rows (or items) will be unknown. To acheive this I want to create a grid with a single row, and two columns containing textboxes to enter the item name and price: +-------+---------+ + Item + Price + +-------+---------+ + Beans + 0.99 + +-------+---------+ Then after the first row has been

Dynamically add row to GridView / DataGrid / Repeater?

二次信任 提交于 2020-01-15 11:39:56
问题 I want to create a "table" that the user will complete which has an unknown number of rows. To illustrate it, let's say it is to enter details from a receipt after a shopping trip - i.e. the number of rows (or items) will be unknown. To acheive this I want to create a grid with a single row, and two columns containing textboxes to enter the item name and price: +-------+---------+ + Item + Price + +-------+---------+ + Beans + 0.99 + +-------+---------+ Then after the first row has been

Binding Path=myObservableCollection Property Expected

╄→尐↘猪︶ㄣ 提交于 2020-01-15 09:20:29
问题 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 DataGridRow.IsNewItem Remained True even after DataGridRow.Item its NOT CollectionView.NewItemPlaceholder

不打扰是莪最后的温柔 提交于 2020-01-15 05:32:10
问题 After tracking the DataGridRow.Item and DataGridRow.IsNewItem properties, I discover that: each added item (to DataGrid when Source is ObservableCollection<MyClass> ), IsNewItem Always positive, Although Item Although he is not a NewItemPlaceholder . Afterwards I looked at MSDN and saw that it was indeed affected by two factors: Gets or sets a value that indicates whether the DataGridRow is a placeholder for a new item or for an item that has not been committed . How do I committ added item?

Field ID conflict inside a JSF form with dataGrid

霸气de小男生 提交于 2020-01-15 05:16:46
问题 I'm implementing a typical shopping cart, based on PrimeFaces' dataGrid component. Below is some sample code. Everything is ok, but the inputText field causes the bean property to be set as many times as there are elements in the page. So, if I put 1 in the first item in the datagrid, it is set, but it's set to 0 N times after this, thus overwriting it. I guess this is because each inputText has the same id. I have tried to enclose the input + commandLink within their own form, but that doesn

Entity Datagrid : best way to add computed values?

旧时模样 提交于 2020-01-15 04:57:06
问题 I have a WPF datagrid databound to a collectionviewsource, which is itself based of a entity query In my grid for example I have 3 columns Number1, Number2, Number3, all properties of an entity. If I want to add a column called SumNumber which is equal to Number1+Number2+Number3, what is the best way to do that so that when I change Number1, the value in SumNumber is updated ? Thanks in advance I'm almost there but I'm getting another error. See below a snippet of code public partial class