I'm building an application that displays some results in a grid, using the Ext.NET controls.
The grid is created dynamically, in the C# code-behind. I would like to let the user see the results in a grouped grid, grouped on the first column in the grid.
I want to do this dynamically, from C#, by changing the existing grid.
How should I proceed, what properties should I use?
You need to use GroupingStore To dynamically change grouping, you need to use this store's groupBy and clearGrouping methods.
Here is good example from sencha -
Grouping.html (js source code - grouping.js)
Maybe the following Grouping example can help get you started, see
http://examples.ext.net/#/GridPanel/Miscellaneous/Grouping/
Related
The ExtJS Grid has multiple sort/secondary sort (sort by one column by clicking on that column's header, then ctrl-click on another column's header to add a secondary sort by that second column) implemented by default.
It doesn't look like the ExtJS Pivot Grid has this implemented. Before I try to copy/adapt the regular grid's logic into the Pivot Grid, I'd like to know if anyone has already come up with the solution for this. If so, would you please be so kind as to share it?
Thanks!
I have an Ext.grid.EditorGridPanel in which I defined several columns.
Per each of the columns, I would like to allow the user to select a subset of items and then present only the rows that contain the selected values.
I thought of something similar to Excel's filter option.
I could not find a method that suits my needs in the Ext 3.3.1 API documentation but I am very new to this so it is quite possible I missed it...
Is there a simple way to do this?
Thanks!!!
First of all your grid panel will be getting data from some kind of data.store http://docs.sencha.com/ext-js/3-4/#!/api/Ext.grid.GridPanel-cfg-store. And there is a way to apply filters according to your rules. See the method description on Sencha documentation: http://docs.sencha.com/ext-js/3-4/#!/api/Ext.data.Store-method-filter
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.
Is it possible to get aggregation with the standard wpf datagrid, similar to the image below (A Telerik Grid)? I dont need summing values, just aggregating values according to one or more columns.
You can use a CollectionView for this, apart from its documentation see linked articles like this. To properly display the Groups you may want to specify a GroupStyle.
I have a grid control in silverlight.I set up pagination for this control.Data is populated from db.I am trying to a sorting on all column headers.However sorting gets applied to specific page and does not apply to entire result set.How can this issue be fixed? Any suggesstions would be of great help.
Regards,
Pri
You can provide explicit IComparer implementations for the columns, as well as event handlers, to handle both questions.
Handle the click event on the header to resort your data however you like.
http://www.longhorncorner.com/UploadFile/nipuntomar/SortingDataSilverlightDataGrid09152008025951AM/SortingDataSilverlightDataGrid.aspx
And leverage the ICollectionView IComparer implementation to do the sorting of the HyperLinks
http://msdn.microsoft.com/en-us/library/system.windows.data.listcollectionview.aspx
(is the text of the hyperlinks all the same, e.g. ClickMe ?)
Also - since Silverlight is running on the client, has all the data been brought to it (or just that page's data, and paging is bringing data to the client)? eg what data source are you using? RIA Services and DomainDataSource? Or your own service calls?)
You might want to use PagedCollectionView. PagedCollectionView gives you lot of functionality out of the box without writing much code.You can use it to sort the data,filter the data,group the data.
Get your data from server in the way you prefer and create a PagedCollectionView with the object collection retrieved from the server and bind the datagrid with PagedCollectionView.
You can sort the data by adding SortDescriptions.
It is explained with examples at MSDN. Especially look for sort section.
Hope this helps.