ARTICLE

Dynamic Data Grid for Windows Forms Sizing Routine

Posted by Mike Griffin Articles | Windows Controls C# November 11, 2003
This article and the attached source code project is called GridLayoutHelper and it allow you to size a Windows Forms DataGrid much like you can an ASP.NET DataGrid.
Reader Level:
Download Files:
 

This article and the attached source code project is called GridLayoutHelper and it allow you to size a Windows Forms DataGrid much like you can an ASP.NET DataGrid.

The Windows Forms DataGrid provides no sizing features,unlike the awesome capabilities of the ASP.NET DataGrid.This example shows a very easy to plug in class I call GridLayoutHelper. With merely one line of code you can attach the GridLayoutHelper to a WinForms DataGrid and dynamically size the columns based on Percentages like the ASP.NET DataGrid.The default sizing routine will size all columns evenly, you can even provide minimum column widths.The nicest thing about GridLayoutHelper is that the columns always take up the total client space of the DataGrid making for a much more professional look.

There are two attachments, a snapshot of what it looks like and a tiny file that contains the GridLayoutHelper with a Windows Forms sample.

Login to add your contents and source code to this article
comments
COMMENT USING
PREMIUM SPONSORS
DynamicPDF™ product line allows you to dynamically generate PDF documents, merge PDF documents and add new content to existing PDF documents from within your applications.
Nevron Diagram
SPONSORED BY
  • PDF reports have never been easier to create. With our included WYSIWYG Designer, you can layout your reports, set up your data source and let DynamicPDF ReportWriter do the rest.
HTML 5 + JQUERY CONTROLS