Data templates in WinForms - c#

I'm trying to have a grid that has items that have a custom layout/feel. If you have a look at the following http://mdavey.files.wordpress.com/2007/05/ldmain.jpg this is kinda what I am trying to do (see the aqua/red pods on the left and the graphs on the bottom right).
Under WPF/ASP.Net I would know how to do this but in WinForms I have no idea (I have never had to work on a WinForms app before). Like in WPF I would use Data Templates.
Hence I was wondering anyone knows of any good resources that goes through this or if anyone knows if its just as easy as creating a custom control, they having a grid that has one column and setting the type of that column to the custom control and then binding the data source to the grid???
Cheers Anthony

You may check Essential Grid - it seems to me it supports features you need.
There is an example for progress bar cell which you could use for the graphs on the right side:
http://www.syncfusion.com/products/user-interface-edition/windows-forms/grid/progressbar-cell
And they have Push Button cell type which you could use for your pods on the left side:
http://www.syncfusion.com/products/user-interface-edition/windows-forms/grid/push-button
You might also check DevExpress XtrGrid:
http://www.devexpress.com/products/net/controls/winforms/grid/dataediting.xml
http://www.devexpress.com/products/net/controls/winforms/grid/appearance.xml
In any case, I would search for a component - it takes quite a lot of time to do such things from the scratch.

Related

How do I make controls extend passed a control bound or overlap with others?

I have a wpf grid setup where I have two custom buttons that are next to each other. First picture is how the design window looks like, however, functionally, it looks like the second picture. I want them to function like the grid doesn't block them (closely resembling the first picture.)
The current xml I have is based on this MSDM which is very basic.
I do not know how to proceed. Do I have to use a different control panel/container or is there a setting to allowed them to extend passed the grid if the other button isn't above it (like zpanel?)
E: I couldn't find any other questions for this, so please link to any searches/posts with information on it.
Turns out I can use canvas and just do a bit more xml to keep the design the same. I would still like to know if it is possible to overlap them in any way for future use.

The best practice to implement custom\user control in WPF

I have a list of custom controls that should look something like this
Before I start to implement them through a custom or user control in WPF (via MVVM), I want to ask if I do everything right. I create a DataTemplate and binding properties I need (these are the numeric values (0.13) in columns) and ItemTemplat'ing it to listview or listbox. Also I'm having an observable collection of viewmodels for these templates and every viewmodel sends some specific numeric data through short intervals from slave device. Also I need this green element to be clicked (just to add a button to a template I guess) and having displayed an additonal window with real time plots. So my question is: Is this the right approach I'm talking about or do I have something wrong? I'm quite new to WPF, so please excuse me. I dont think that it is a great challenge to implement something like this.
I'm rather new to this model as well, however one thing I have found that has helped me with managing multiple View Models has been an IOC Locator. An example can be found here:
http://dotnetpattern.com/mvvm-light-toolkit-example

WPF Control Identification

Sorry but I am a newbie to WPF, I would really appreciate if you could help me-
Tag 1 in pic- Which control can I use to create a menu similar to that in the picture ? The closest I came was using a gridview within a listview but that ends up using a header for the gridview. Normal listview just highlights the entire strip and doesn't look good at all.
Tag 2 in pic // (No longer relevant, sorry)
Edit:
Looking for something simple like when using gridview with listview (as in pic below) there is automatically that standard window gradient & bevel effect etc. (As an idea, implementing it with buttons seems to cumbersome, first strip button border, then create all these effects.) So essentially anything already inbuilt in WPF.
Thanks for any help :-D !!!
ListBox or ListView are good controls to use. If it's just the 'pretty' factor you don't like, you can provide Templates to change the appearance. But functionally, ListBox and ListView provide the function of that menu.
When working with WPF, that should be your primary motivation when choose controls. What FUNCTIONS the way you want. You can always make it LOOK different with Templates, but getting the right FUNCTION is the primary goal for the control.

Delphi equivalent of C#'s DataGridView

Is there any real equivalent of C#'s DataGridView in Delphi?
I have tried
TStringGrid
But the scrollbar is either invisible when all the items are visible, or it is the smallest scrollbar possible no matter how little the items are overflowed and only updates when the scrollbar is released, not when it is being dragged
Also, if you have one fixed row, you have to have at least one (empty) row besides that, which is inconvenient and unsightly
TDBGrid
But I can't seem to figure out how to add items programmatically (and I don't think it's meant to do that anyway). If I could do that, TDBGrid would be fine for me to use.
So what is the Delphi equivalent of C#'s DataGridView that doesn't have the problems listed above?
The DataGridView is a very flexible control which can work in bound and unbound modes, in the Delphi side you must choose bewteen 2 kinds of controls, for example if the content of the control can be edited directly (unbound) you can choose a component like a TStringGrid or in bound mode which in delphi is called data-aware you must choose something like a dbgrid, in this last case you edit the dataset asociated to the control and the control reflect the content of the dataset. Using this last scenario. you have several options about the dataset component to choose maybe the most flexible is the TClientDataSet. if you want learn more about this topic check these links
Understanding datasets Index
Types of Datasets
Opening and Closing Datasets
Modifying Data
Note : in the last version of Delphi (XE2) a new concept was introduced called LiveBindings, which introduces big changes in how you can bind a object or component to a collection or another component.
I would recommend you to check DevExpress.com QuantumGrid - it works both in Bound and Unvound mode

Create a custom Data Grid from Silverlight

I'm watching at this page:
http://leeontech.wordpress.com/2010/02/01/summary-row-in-datagrid/
But they're using silverlight. I'm trying to create that user control to use it in a WPF C# application. I mean, not using Silverlight. But I can't find the namespaces: GroupHeader
I'm having a hard time with this. Thanks in advance.
Okay listen, you can totally do this, and in some scenarios I even recommend it.
Using a CollectionViewSource you can easily group your data. In the HeaderTemplate you can even use an Expander (or make your own) and get the animation you might be wanting. Here's a link to a sample of this: http://jerrytech.blogspot.com/2010/06/wpf-data-presentation-step-by-step.html
Using an ItemsControl, you can easily present your groups and details. In the ItemTemplate you can use styles make this look like a grid (if that is really what you want). You can also shift the style based on the type if your collection has more than one type of object in it (eat that datagrid!).
You can wire up your column headers (which will really be custom objects, right?) and handle all the sorting and stuff like that. They will look just right! Not like datagrid WinForm column headers!
Here's what's hard (not impossible, but more coding).
User-resizable columns.
User-rearrangable columns.
New record using bottom, empty row.
Paste from Excel (doesn't work right in datagrid either).
Select Row, highlight Column header.
That's it.
In lots of situations, this is really nice.
For the most part, I cannot stand the datagrid. Too restricting on UX.
I don't think you're not going to be able to get a silverlight control working in WPF.
Adding a footer row to the WPF datagrid is something a lot of people have complained about; it's ridiculous that it wasn't included out of the box.
See this thread from MSDN
Having been through this myself, your best bet will probably be to bite the bullet and use a third party control. It sucks, I know.

Categories

Resources