Extjs PropertyGrid with multiple Sources - extjs

Is it possible to have an extjs (classic) propertygrid with multiple columns for multiple data sources? We want a component where we can manage the pricelists/product matrix. Of course, we could do it with a table but this looks strange since you might only have two rows then and is far off from how the end result would look like. We are right now on extjs 6.x with the classic toolkit. How would you implement such a component based on the grid component since every column is expected to have one datatype but for a propertygrid every row column can be different in type?

I created an example of the grid you need. I overridу some celleditor methods and the headercontainer(used in propertygrid) constructor (this should not affect the other components), and I also defined a new component, the columns (additionalColumns) of which can be supplement in the same way as in the grid.
With help verticalCellTypes you can specify the same data types for the column or row

Related

How does the ExtJS4 Column class work?

I wrote my own sub-class, for some selection stuff and paging etc. But those all worked with the renderer(), which required them to return a string.
This worked fine, I created some image-tags and returned those.
But how does this class work in detail?
I want a sub-class which displays a chart in a cell, which should technically be no problem, but the renderer() doesn't seem the right place for it, since it only works for strings.
Does the Class get instantiated for every row? or is it really just one instance for a column, which methods get called for every row with the needed data and the instances don't hold any state about the rows?
The renderer() mechanism is actually implemented in Ext.grid.column.Column, for which there is one per column.
As you have mentioned, the renderer() function returns a string, which could be an HTML string (which could be rather complex - have a look at the templates used by ExtJs for the standard columns). But you cannot return a component (chart).
To the best of my knowledge (based on my own understanding and replies to similar questions), ExtJs does not offer a straight-forward way to render components within grid cells. If you really think about it - you are asking a grid for much more than its intended role. It was designed to present records per raw, with the addition of simple user interaction facilities, like checkboxes.
But what you are really asking for is more of a way to layout charts, for which problem i suggest you look into the Table layout.
Alternatively you should be able to render a chart into a dom element, which will be defined in your own custom column template. But I will consider this to be an involved task.

How to properly manage a dynamic table of data for gui

So I need to display a DataGrid in WPF. I'm using RadGridView from Telerik and Caliburn.Micro framework using the MVVM strategy.
In my presentation there are differing number of columns, X+2 to be exact as there is always a Label column and a Total column and then X number of others that hold a decimal number.
I do know the number at runtime before I create the classes I need so that could help.
So I'm currently considering a few methods of doing this but some of them have drawbacks so I would love if someone could point me towards a solution.
Create a ViewModel class for each row and for each Cell. The X number will be a collection and binding to it is problematic. I would need to customize the RadGridView itsefl to actually manage this.
Create a DataTable an the run and bind to it. I haven't managed to make this work and not sure if RadGridView actually supports DataTable. This will also not allow me to keep metadata for each cell, something I need to be easily able to update the cells because column + row aren't the only distinguishing keys I need.
Somehow dynamically create a object with x+2 properties to bind to.
Are there any solutions, guides or something out there to help me here?

DataGrid that masks columns

Can a DataGrid dynamically mask the columns to be displayed?
Current Setup
DataGrid <--Binding--> Collection<Customer>
The type Customer has about 100 different fields defined.
Different views need to display different sets of columns (about 20 out of 100), chosen somehow dynamically, of the same Collection<Customer>.
Is there an option to dynamically mask the fields that will be displayed as columns in the DataGrid? Ideally, I want to use Infragistics' xamDataGrid, but any solution for a DataGrid will be a good starting point.
There are other similar questions out there, but they deal with either column filtering or variable number of rows.
If you are defining different views in code you could create different FieldLayouts and use the FieldLayout for the view that is needed. This would require setting the FieldLayout to be used in code by adding the layout to be used to the FieldLayouts collection.
If you are allowing the end user to define what is in the view, then you will likely want to define all possible fields and then allow the fields to be hidden or shown with the Field Chooser.
There are methods for saving and loading customizations to the fields that you can use to persist the layouts.

Creating an Empty DataGrid

I was wondering what the best way was to create an empty datagrid.
For example after you have hit new in excel, You have a grid with empty rows and columns.
I am using c# with WPF and .net 4.0.
Thank you.
As the comments have suggested, a datagrid is not a spreadsheet, but a method to display / edit existing data. That said if you want something similar, feel free to populate a collection with default / 'empty' objects and bind that to your grid. It just means that after working with the data, you will have to define a method to capture only the edited rows. This still means that the column-bound properties of your class need to be known ahead of time.
A DataGrid is used to display a collection. If you want to create an individual row DataGrid is not really the right tool. You could but a single empty row in the DataGrid using a collection of only on row. There is a lot of guidance on Master Detail on MSDN. If you don't know how many columns at design time you could used a DataGrid to turn the row vertical with column 1 as name and column as value so now you have one record but with a collection of fields.

Dynamic row and column span in WPF DataGrid

I'm working on a new project where the design calls for dynamic rows and columns displayed in some form of grid. I think I can accomplish this very hackishly using the plain ol' Grid, but it seems like it should be possible using a "real" grid.
In my mockup, I circled the tricky bit in red. Under column 1, I have effectively 2 columns of data. The problem is the fact that my data in column 1 can span multiple rows. And the fact that column one is really two pseudo columns and each one can span a different number of rows independently. Note: the data is fake and inconsequential. I'm open to ideas for a good implementation. I can fall back to the Grid and do this all in code behind, I'm open to purchasing a datagrid that may have more power than the DataGrid and my absolute last resort/preference is to restructure this format to something a little more doable.
Thank you for any ideas you can provide.
Most commercial WPF DataGrid implementations handle hierarchical data like this. For example, Telerik's DataGrid (part of RadControls for WPF) supports hierarchical data in multiple formats.
Typically, the default styling is a bit different than yours above, but can be adapted to that format via styling.

Resources