Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    text
    copied!<p>It would be very helpful to see the structure of your data. What in the world is a "unified comment - list"? What do you mean by "irregular data"? </p> <p>Anyway, in my experience, the best tool in Winforms to deal with tabular data is <code>DataGridView</code>. You can have combobox cells, image cells. You can easily format and color them, validate and disable when necessary.</p> <hr> <p>Edit: more info</p> <p>What you need is basically some colspan, easibly obtainable in HTML grids. You can't do that easily in DataGridView, quoting the Ms DataGridView program manager</p> <pre><code>The DataGridView does not have any support for merging cells. You can custom paint content across cells, but apart from that you would have to do a lot of work and custom coding to produce merged editable cells. </code></pre> <p>but you could buy a 3rd party component (<a href="http://www.telerik.com/help/winforms/gridview-overview.html" rel="nofollow noreferrer">Telerik GridView</a> or similar) or search for a custom implementation like this:</p> <p><a href="http://www.codeproject.com/Articles/34037/DataGridVewTextBoxCell-with-Span-Behaviour" rel="nofollow noreferrer">DataGridVewTextBoxCell with Span Behaviour</a> </p> <p>Maybe this can be useful too:</p> <p><a href="http://www.codeproject.com/Articles/18330/Multi-Column-Combo-Cell-for-NET-2-0-DataGridView-c" rel="nofollow noreferrer">Multi Column Combo Cell for the .NET 2.0 DataGridView Control</a></p> <p><a href="http://social.msdn.microsoft.com/Forums/windows/en-US/fea3dcff-5447-450a-8f7c-bb1c4f63371d/merging-cells-in-datagridview?forum=winformsdatacontrols" rel="nofollow noreferrer">http://social.msdn.microsoft.com/Forums/windows/en-US/fea3dcff-5447-450a-8f7c-bb1c4f63371d/merging-cells-in-datagridview?forum=winformsdatacontrols</a></p> <hr> <p>EDIT 3: Ok, if you just need to display your data why don't you try adding in your winform a <code>webBrowser</code> component, compose your HTML text and then display it? You can add style, font, colors etc etc like any web page.</p> <p>Sample</p> <pre><code>private void showHtml() { var htmlstring = @"&lt;html&gt;&lt;table border='1'&gt; &lt;tr&gt; &lt;td&gt;Red&lt;/td&gt; &lt;td&gt;Green&lt;/td&gt; &lt;td&gt;Purple&lt;/td&gt; &lt;td&gt;Blue&lt;/td&gt; &lt;/tr&gt; &lt;tr&gt; &lt;td colspan='4'&gt;Comment that is one single piece of data&lt;/td&gt; &lt;/tr&gt; &lt;tr&gt; &lt;td colspan='2'&gt;Foo&lt;/td&gt; &lt;td colspan='2'&gt;Bar&lt;/td&gt; &lt;/tr&gt; &lt;tr&gt; &lt;td&gt;Red&lt;/td&gt; &lt;td&gt;Green&lt;/td&gt; &lt;td&gt;Purple&lt;/td&gt; &lt;td&gt;Blue&lt;/td&gt; &lt;/tr&gt; &lt;tr&gt; &lt;td&gt;Red&lt;/td&gt; &lt;td&gt;Green&lt;/td&gt; &lt;td&gt;Purple&lt;/td&gt; &lt;td&gt;Blue&lt;/td&gt; &lt;/tr&gt; &lt;tr&gt; &lt;td colspan='4'&gt;Comment that is one single piece of data&lt;/td&gt; &lt;/tr&gt; &lt;tr&gt; &lt;td&gt;One&lt;/td&gt; &lt;td&gt;Two&lt;/td&gt; &lt;td&gt;Three&lt;/td&gt; &lt;td&gt;Four&lt;/td&gt; &lt;/tr&gt; &lt;/table&gt; &lt;/html&gt;"; webBrowser1.DocumentText = htmlstring; } </code></pre> <p><img src="https://i.stack.imgur.com/xeoJL.png" alt="http://oi40.tinypic.com/2uygkjt.jpg"></p>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload