DataGridView in Windows C# - winforms

Can i design datagridview of windows form control, Like Datalistview of webcontrol.
Like vertical align datagridview(Column and data).
Any suggession?

Related

Can I add an ElementHost to a regular WinForm StatusStrip?

I just started learning WPF, and I've been trying to add this WPF control to a regular WinForm.
I know I can use Forms.Integration.ElementHost to host WPF controls in a WinForm. But as StatusStrip takes Items and not Controls it's marking the ElementHost as incompatible.
Do I need to replace the entire StatusStrip with WPF ToolBar for this to work?
You can use ToolStripControlHost to add any control to the strip. For example for an element host which hosts a wpf user control, you can use this code:
var host = new ToolStripControlHost(this.elementHost1);
this.statusStrip1.Items.Add(host);

Managing lots of controls in FlowLayoutPanel

I have a C# 4.0 Winform app, the main form of which is visually divided in half: a TreeView on the left (for navigation of data) and a FlowLayoutPanel on the right. The contents of the FlowLayoutPanel changes based on user interaction (mainly with the TreeView).
The content to be shown in the FlowLayoutPanel is comparmentalized into a number of "blocks" - some are UserControls whilst others (I'm embarrassed to say) are Panels containing various Controls.
My issue is that the number of "blocks" is now too many to see in the Visual Studio form designer, and I can't make the form large enough to see them all; this makes it hard to verify how the UI will look without running it.
How can I manage the contents of the FlowLayoutPanel so that I can see all of the controls, or am I going about it wrong?
While in the designer, make sure you have AutoScroll property set to true, which will enable you to scroll the FlowLayoutPanel child controls while in the designer view.

wpf datagrid.How to Merge or group cells..?

I am trying to Merge cells in WPF toolkit datagrid .I am trying to do something as shown in the image below.We can do this in Winforms datagrid.But how to do this using WPF toolkit datagrid ?.Or is there any alternative controls..?
Can we do this using listview or listbox..?
Or is there any free controls available which have this functionality ?

EditItemTemplate in silverlight gridview

I am converting some ASP.Net controls to Silverlight. Is there something similar to ASP.Net's EditItemTemplate in Silverlight's DataGrid or ListBox?
Edit templating in the Silverlight DataGrid is performed at the cell level. If the DataGrid default choices are not what you need then you need to use the DataGridTemplateColumn and define both a CellTemplate and a CellEditingTemplate.
The ListBox does not support the context of an "edit mode" however you can supply an ItemTemplate which contains control such as TextBox which will allow editing of the underlying data.
With the DataGrid you will have control over the Item and the EditingItem. Check this series of DataGrid related posts on my blog:
WPF Toolkit DataGrid, Part I – Introduction
WPF Toolkit DataGrid, Part II – Custom Styling
WPF Toolkit DataGrid, Part III – Playing with Columns and Cells
WPF Toolkit DataGrid, Part IV: TemplateColumns and Row Grouping

Transparent background for a control

I'm developing a winforms application (using .NET 3.5)
In a form I have a panel control ,and a datagridview control inside of it .
I want to have some control ( let's say for the simplicity - a label)
to appear in front of the datagridview , and I want this label to be transparent - which means : I want to see the data displayed in the gridview behind .
I just want to see the text that is in the label , but not the whole rectangle .. and behind that text - to see the data I have in the gridview.
The problem is the following : the parent control of the label is not the gridview
(since it's not a container control ) . The parent of the label , is the panel control .
So when I set the label to be transparent .. I actually get transparency to the panel , and not to the datagridview.
Check out this CodeProject article:
How to Use Transparent Images and Labels in Windows Forms
Also, you could always use GDI (System.Drawing) and just draw what you want directly onto a transparent panel?
Set the panel to also be transparent. It shouldn't cause any trouble with the panel, since you'll still have the form itself behind it.
There is one other issue to warn you about as well. Transparency in winforms controls is only simulated or faked, in that when you create the control it takes an image of the form behind the control and uses that for the background, rather than truly making it transparent. This can cause issues if that background changes or the controls moves around on the form.

Resources