-
26334980 said 12 months ago:
want to draw a line between two specified cells with a zero in,
thanks for your help
KerryAttachments:
You must be logged in to view attched files.| #Hello,
In order to draw line around the cells having zero, you need to make use of the OwnerDrawCell event of C1FlexgRid. A sample is also available for your reference and the same can be downloaded from the following link :
http://our.componentone.com/samples/winforms-ownerdraw
You can also refer to the one of the similar forum issue :
http://our.componentone.com/groups/winforms/flexgrid-for-winforms/forum/topic/43315
Hope it helps! Let us know if you still face any issues.
Regards,
Mohita| #26334980 said 12 months ago:
two samples are both not my desire, my desire is like the following
draw a line from a cell center to another cell center which has a zero
i don’t know how to write code.
Attachments:
You must be logged in to view attched files.| #Hi,
You need to implement this in OwnerDrawCell event of the grid. Now, to get it triggered, you need to set DrawMode property of the grid to OwnerDraw. Then use this code:
Point pt1; Point pt2; void c1FlexGrid1_OwnerDrawCell(object sender, C1.Win.C1FlexGrid.OwnerDrawCellEventArgs e) { if (pt2 != null) { pt1 = pt2; if (e.Text.Contains("0″)) { Rectangle rect = e.Bounds; pt2 = new Point(rect.Left + rect.Width / 2, rect.Top + rect.Height / 2); e.Graphics.DrawLine(new Pen(Brushes.Black), pt1, pt2); } } }And then you get lines connecting center coordinates of cells like the screen shot.
Cheers,
Anupam.Attachments:
You must be logged in to view attched files.Answer| #Viewing 4 posts - 1 through 4 (of 4 total)You must be logged in to reply to this topic.
FlexGrid for WinForms
how to draw a line between two specified cells
- Downloads
- Products
- ComponentOne Ultimate
- Studio Enterprise
- Studio for WinForms
- Studio for WPF
- Studio for Silverlight
- Studio for Windows Phone
- Studio for ASP.NET Wijmo
- Studio for iPhone
- Studio for Entity Framework
- Studio for ActiveX
- Studio for Compact Framework
- Studio for WinRT XAML
- Studio for WinJS
- ActiveReports
- Spread Studio for .NET
- Spread for WinForms
- Spread for ASP.NET
- Spread WPF-Silverlight
- Spread WinRT
- Spread COM
- Wijmo - HTML5/jQuery
- Maps Powered by Esri
- Studio for LightSwitch
- OLAP for WinForms
- OLAP for Silverlight
- OLAP for LightSwitch
- IntelliSpell
- XapOptimizer
- Doc-To-Help
- DemoWorks
- Support
- Community
- About
- Store
As a leading component vendor in the Microsoft Visual Studio Industry Partner program, ComponentOne has been providing the widest range of Microsoft Visual Studio components, IDE platform development tools, and applications for over 22 years. ComponentOne product lines encompass custom WinForms, ASP.NET, WPF, Silverlight, Mobile, and COM components, documentation tools, and Web Parts for Microsoft Office SharePoint Server and Windows SharePoint Services.
Contact ComponentOne: 1.800.858.2739 | Pittsburgh: 412.681.4343
©2013 ComponentOne LLC All Rights Reserved.
All product and company names herein may be trademarks of their respective owners.
ComponentOne holds a license under Patent No. 5,490,216 (which expires on September 21, 2013)

