I have a requirement for a 4.2.1 ExtJS app that Im building, to have a grid like the image below:
The objective of the grid is to manage Holidays for employees.
I was thinking in setting the columns of the grid dinamically, but will need to fill the background cell depending of the type of "leave type", and also disable some cells depending on the days that are not supposed to work (like weekends, etc).
Any advice on how can I approach to the solution? Appreciate in advance.
There is a commercial scheduler that does exactly that and more. See http://bryntum.com
Related
I've tried implementing the first suggestion from C# Winforms DataGridView Time Column, i.e. showing a DateTime picker in a DataGridView.
However, when I launch the app and select a date from the dtPicker and then select the next row, the value disappears in the first cell where I had selected a date.
What changes are needed for the cell to keep displaying its value while creating additional rows in the DataGridView?
I found another solution, which solved the issue. It's much cleaner and easier to implement. The solution was in an article titled:
Embedding Calendar (DateTimePicker) Control Into DataGridView Cell
https://www.c-sharpcorner.com/UploadFile/0f68f2/embedding-calendar-datetimepicker-control-into-datagridvie586/
The code suggestions in the above article work well for every row in the DGV.
I need to display in my program number of similar statistics, like:
Name / Age / Salary / Position
John 30 1000 senior
Kate 18 100 intern
... .. .. ...
Totally I need to display several hundreads lines.
The question is what control should I use?
At least I know two options:
use Table control
use Grid layout (then dinamically add labels etc. to the grid)
I think with Grid I will automatically have "custom rendering" because I can add anything into Grid, not only "Label", but also buttons for example. However I'm not sure if I need such possibility.
But I need ability to sort the table by certain column.
So it seems "Table" better feets my needs, however I noticed that it seems that "Table" is not very popular in WPF (am I correct? why?)
So the question is "Should I use Table or there is someting better?" Is it possible to use databinding with Table?
I'm absolutely novice to WPF so sorry for any stupid questions :)
DataGrid and GridView were built for exactly that. When you bind a source it creates a table like row for each row in the source.
Either use a DataGrid or a ListView (with GridView), do not use a Grid, and what is this Table you speak of? If you mean this class, that can only be used in flow documents, which you do not need.
(See the documentation pages for examples or do some searching)
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.
In Excel, there is this feature for filtering the cells of a column.
How can I implement excel like FILTER feature in Silverlight Datagrid?
Please advice. Thanks
AJ
Good question - this is a good feature, but not one that can be implemented in 5 minutes.
You don't want to be overriding the rendering of the standard datagrid in any way (too much work), so you need to take a slightly different approach. One way to do that is to draw your own 'header' above the top of the grid - just a grid, with a border and a stackpanel will get you started. Then you need to enumerate the visible columns of the grid, and create a dropdown corresponding to each, and add that dropdown to the stackpanel. Using a simple linq statement you can get a list of the distinct values in each column. When the user selects a value from the dropdown you can then filter the grid's datasource using that value in a LINQ statement.
In reality this is probably going to be at least a week's worth of work to do properly. If you take the cost of that development and the cost of the testing, and measure that against the cost of a good component suite where they already have filtering built in (most of the major vendors do), then unless you are working for a very low hourly rate you will find it is cheaper to buy the components - it is probably safer too, as the components will be well tested and realtively bug free.
Edit (some time later): what i should also mention though is that if you only want to do this on a couple of columns then you could consider using a column header template. If you take this approach though you will also have to do things like copy the various mouse related animations or transitions that might be part of the original colunm header, just so you can keep some consistency across the top of the grid. Personally i would just go with option one and give the user the ability to filter on any of the columns.
Greetings,
Currently I am in process of developing an application for booking (etc. rooms). The most painful thing in front of me: "The booking chart". It should looks similarly to the following thing:
http://img195.imageshack.us/img195/4807/99573694.gif
Any suggestion how can I build the "skeleton" of the booking chart? should i use grid etc? I would like to navigate through the days and additionally passed number of items and current datetime range
Looking at your example it looks like a job for DataGrid (http://wpf.codeplex.com/Release/ProjectReleases.aspx?ReleaseId=29117 if you're on WPF 3.5, it's part of WPF 4).
I would implement the navigation functionality by using LINQ to filter your data set to the range you're interested in. The navigation controls would have to be provided by you separate from the DataGrid.
Hope that helps...
This looks similar to the Scheduling tool Billy Hollis shows in dnr tv number 115 which is a listbox on its side.
http://www.dnrtv.com/default.aspx?showNum=115
Mike