xamdatagrid

MVVM - How to create columns at runtime for a xamdatagrid?

假装没事ソ 提交于 2020-01-01 05:01:07
问题 I have to create a XamDataGrid that shows a dynamic amount of columns for a time frame x to y. Therefore I dont know how many years a user would select to have these columns created upfront. Now usualy within MVVM you would just populate the data through as many Properties as you would need Columns within your XamDataGrid, and the latter would just autogenerate them. Obviously I couldn't just create Properties within my ViewModel at runtime unless I did something crazy with Reflection. How

Infragistics XamDataGrid with variable number of columns

懵懂的女人 提交于 2019-12-23 20:56:54
问题 I need to be able to support a XamDataGrid which at design time will not have a set number of columns. For example, the app will run, get some data from the server and create some objects. Depending on the response from the server, I may have a different number of objects each time I run the app. Here is an example of what I mean. Lets say I make a call to some service and get back an xml response with some info. I deserialize that response into a number of objects, which can be different

XamDataGrid column visibilty is not working using MVVM

橙三吉。 提交于 2019-12-23 10:09:18
问题 I'm trying to implement XamDataGrid column visibilty in a MVVM architecture and it does not seems to be working. I'm doing the following: Adding Visiblility property for an unbound field - <igDP:UnboundField Name="gridCustomerId" Label="ID" Binding="{Binding customerid, Mode=TwoWay, UpdateSourceTrigger=PropertyChanged}" Visibility="{Binding ShowCustomerIDColumn, Mode=TwoWay, UpdateSourceTrigger=PropertyChanged}"> In my View Model, adding a proerty of Visibility type: //ToShow CustomerID

Calculation on a realtime changing collection ( in c#)

风流意气都作罢 提交于 2019-12-12 04:14:41
问题 I have a changing collection of changing objects(add/delete in Collection as well as property changes are also possible). I want to get a new collection by some calculation on this Collection (summation / multiplication over some fields of all the objects having same value of a field). And bind calculated list to UI. for Ex: So I have a list of rate and qty of different qualities of several fruits and now I want to find a new list having avg rate and total quantity of each fruit(irrespective

XamDataGrid (2011 - 2012): How do I replace a fields converter + fieldsettings dynamically using XAML?

|▌冷眼眸甩不掉的悲伤 提交于 2019-12-11 10:44:02
问题 I've got a XamDataGrid containing a few fields including these two: <igDP:Field Name="MinValue" Label="Min." Converter="{StaticResource DivideBy1000Converter}" Column="5"> <igDP:Field.Settings> <igDP:FieldSettings CellWidth="60" AllowEdit="True" CellValuePresenterStyle="{StaticResource minValueCellEnabled}" EditAsType="{x:Type System:String}" EditorStyle="{StaticResource DecimalMWhStyle}" CellClickAction="EnterEditModeIfAllowed" /> </igDP:Field.Settings> </igDP:Field> <igDP:Field Name=

Cannot apply cellValuePresenter/TypeConverter to XamDataGrid cells

不羁岁月 提交于 2019-12-11 03:54:40
问题 I also asked this at Infragistics, but don't know how to format my code there, so here it is properly formatted. My goal is to present a table of structured data with the text of each cell using multiple colors. I have a typeconverter which will convert the data stored in a custom class to a label or textblock containing several text elements with different colors. The data is provided in a datatable (any method that works will be fine) and each value is correctly applied to a cell. The

WPF Binding : Add Button to Unbound Field in grid

妖精的绣舞 提交于 2019-12-11 02:53:29
问题 I am trying to add a button to an unbound field in XamDataPresenter. Here is the button template: <Style x:Key="CancelButtonTemplate" TargetType="{x:Type igDP:CellValuePresenter}"> <Setter Property="Template"> <Setter.Value> <ControlTemplate TargetType="{x:Type igDP:CellValuePresenter}"> <Button x:Name="CancelButton" Content="Cancel" Command="{Binding CancelButtonCommand}" Width="80" Height="20" /> </ControlTemplate> </Setter.Value> </Setter> </Style> And here is the unbound field in

True MVVM and third party controls

限于喜欢 提交于 2019-12-09 18:29:48
问题 In a True MVVM model we do not expect any code behind in xaml.cs also we do not expect viewModel to have refernece of view. However all third party controls do not provide good support for True MVVM. In my case I am using Infragistics xamDatagrid control and I want to export its data to excel. The only way I can export data to excel of data grid is by using following code: xamDataGridExcelExporter.xamDataGridExcelExporter xamDataGridExcelExporter1 = new xamDataGridExcelExporter

True MVVM and third party controls

天涯浪子 提交于 2019-12-04 08:26:45
In a True MVVM model we do not expect any code behind in xaml.cs also we do not expect viewModel to have refernece of view. However all third party controls do not provide good support for True MVVM. In my case I am using Infragistics xamDatagrid control and I want to export its data to excel. The only way I can export data to excel of data grid is by using following code: xamDataGridExcelExporter.xamDataGridExcelExporter xamDataGridExcelExporter1 = new xamDataGridExcelExporter.xamDataGridExcelExporter(); xamDataGridExcelExporter1.Export(**this.xamDataGrid1**, @"C:\Excel\ExportFile.xls");

MVVM - How to create columns at runtime for a xamdatagrid?

試著忘記壹切 提交于 2019-12-04 05:34:57
I have to create a XamDataGrid that shows a dynamic amount of columns for a time frame x to y. Therefore I dont know how many years a user would select to have these columns created upfront. Now usualy within MVVM you would just populate the data through as many Properties as you would need Columns within your XamDataGrid, and the latter would just autogenerate them. Obviously I couldn't just create Properties within my ViewModel at runtime unless I did something crazy with Reflection. How else would I achieve this? Should I just create unbound fields for the datagrid and fill them through