DevExpress Charts Question - c#

Is it possible to create chart (as shown on screenshot) in DevExpress Chart control?

I have developed something similiar, already. I learned that it is better to use XtraGrid instead of the chart, as pattern matrix. The I used CustomCell drawing feature to draw colored bars according values in the cell.

Avoid DevExpress charts if you are rendering anything more than 100 data points. At least in v14 and v15, the charting controls are very, very slow compared to most things out there. Every time it redraws, you have to wait seconds for it to redraw.
This does not detract from how awesome the rest of DevExpress is (its my library of choice for everything else).

I think a different component (Pivot Table) is a more suitable solution here.
For instance, DevExpress PivotGridControl supports in-place editors such as Progress Bar (see the following example).
In addition, you can hide cells with zero values by handling the CustomCellDisplayText event and setting the e.DisplayText property to an empty string.

The simple answer is YES, it is possible

Related

Alignment of text when column width is changed from GUI in winform application

I have developed a winform application. It has a listview with multiple columns having different texts. Initially, I have set the column width = -2 to take the size of longest text in the column.
The issue is that sometime text overshoots the laptop screen and a horizontal scroll bar appeared in the list view.
To fit all the columns in a screen, I manually modified the columns widths using column boundaries in the GUI. When I modify the column width, the column text starts disappearing from right. I want it to disappeared from left.
I have searched goggle a lot but did not find the answer.
Question might look weird or may be I have not explained it properly. Please let me know if more information is needed.
Thanks in advance.
The Listbox columns in Windows Forms are not exactly a high level control, I've used it some times but just for simple lists, It certainly has not a builtin function to make what you want, to obtain it you probably need to subclass the control, create a new class for the item managed in the list and write some code to perform what you need.
I think you can find some hints on how to achieve all this in Charles Petzold book about windows forms where he shows how to measure a string and how to draw directly on your control.

C# WinForms 4-sate checkbox

Using VS2013, C#.NET 4.5, and WinForms. Migrating to WPF is not an option at this point.
The standard checkbox control handles 2-state and 3-state modes, but I need a 4-state checkbox. I can't find a 4-state checkbox library on the net anywhere, so I'm assuming I'll have to make one (if y'all know of one, that'd be great).
I have a set of four PNGs as draft images of the checkbox appearance, and I have played around with just painting those on a button and having the button_click event cycle through which image is displayed and update the data value. This doesn't seem to scale the image with the button well, though, and it feels kludgy to load static bitmaps instead of vector drawing the images so they're always to scale.
Is there a way to inherit from the checkbox control itself and add a fourth state?
If so, where do I go to override how the states are drawn? I need to do it "correctly" so that if the form is Scaled, the checkbox doesn't end up looking all bitmap-nasty.
I'm not even sure what keywords to use to search for how to do the actual drawing.
Background:
I'd generally consider this to be a nasty UI choice, but I'm making a program that saves, loads, and displays a "World of Darkness" character sheet of any arbitrary system, and the WoD games use a 4-state injury that's represented on the sheet by an empty box, a box with one slash across it, a box with an X across it, or a box with a 4-stroke asterix across it (optionally, a filled box).
For the moment I'm going with matching the original with high fidelity; later, as an option, I'll let the user switch to radio buttons to support my own preference.
This is my first real exploration of GUI programming beyond the basics, so I'm not sure quite how to proceed.
EDIT: I'm delving into a UserControl now, and my own draw methods. What fun. Found an MSDN tutorial on User-Drawn Controls, seems like a good starting place.

Remove the second row in x-axe of Chart

I use WPF toolkit Chart control. How to remove the second row in x-axe of Chart?
It's not a second row, it's juste "space management" of labels. You must set another datetime format in order to let enough space for the rendering.
I working with Telerik RadChart and there you can rotate the labels, so if you use let's say an angle of 45, they will line up nicely without and overlap. Maybe it's possible to in your language? Try look for it, I would not be surprised if you could do the same.

Custom Text Box Component / Element (Not a Control)

I am in need of a class that mimics a TextBox control but is not a Control, but instead a custom drawn component or element.
Creating one feels like re-inventing the wheel since I see them everywhere. For example, in any modern web browser the text boxes are not controls. Most Winforms controls, especially ToolStrip controls such as ToolStripTextBox, have elements which behave like text boxes (but are not Controls).
I assume that Microsoft doesn't reinvent the wheel for each control they make it. But most likely their code is proprietary and not public.
Does any one know of an open source solution for this? I am experienced with GDI+ drawing but a text field is not a trivial task when you consider caret positioning, selection, and inserting text.
Any pointers on how to go about writing the code myself would be appreciated, such as how to calculate the character at a given point. Should I create a lookup table for the measured width of each possible character? Or loop through MeasureString to take into account formatting space?
You may find the code you need inside this article/project. http://www.codeproject.com/Articles/161871/Fast-Colored-TextBox-for-syntax-highlighting
Why must it not be a Control? If you're using Windows Forms, it is far more likely that you really want a control.
Common cases where this type of question might come up are Grid editing. Instead of a non-control TextBox, what normally happens is that the grid displays simple text in the grid until the user focuses on that grid. At that point a temporary, real TextBox is inserted for editing. Leaving that cell throws the TextBox away and the possibly-changed text is now displayed by the Grid.
I assume your situation is similar. If not, please explain your goals.

Header control in WinForms - any such thing?

I'm trying to use the windows native (Theme-aware) header control to display just some column headers. The main purpose is to avoid manually drawing the column headers and rely on the natively supported functionality.
So the 2 options I was thinking of are:
Use a HeaderControl, and add columns to it (I can't seem to find a header control supported by WinForms).
Use a ListView control, and tell it display no rows (or basically set its height to the height of the column header) - can't find any way to determine which height should I assign to the control.
Any good ideas much appreciated!
There is no HeaderControl for WinForms in the .NET framework so far (the ListView utilises the ColumnHeader class but this is only useful with the ListView). If you are only targetting Microsoft Windows, you could look at wrapping the Win32 control for use in .NET although I expect that will be substantial work.
Your second option is a valid possibility even though it feels somewhat clunky. I can see difficulties arising in getting the list to size properly such that the header and only the header is visible.
A third option would be to roll your own HeaderButton that represents one column (like ColumnHeader) and use the theme drawing calls to draw it, then just combine them in a FlowLayoutPanel or TableLayoutPanel into your header bar. If you want resizing, you could make the HeaderButton have a grab region that you can pick up and alter its width.
I think the third option will be reasonably simple to create, even with the sizing ability, so I would recommend taking that route (I might even give it a go myself when I get home tonight).

Categories

Resources