Home - Forums-.NET - FlyGrid.Net (Windows Forms) - Infer Columns from Dataset

FlyGrid.Net (Windows Forms)

.NET Datagrid - Fast, highly customizable, industry standards .NET data grid control for WinForms

This forum related to following products: FlyGrid.Net

Infer Columns from Dataset
Link Posted: 04-Oct-2007 02:17
Hello,

I would like to have a FlyGrid infer the column names, types, and determine widths from a Dataset.  Ideally, I was wondering if there was a way to do the following:

Given a dataset, the FlyGrid creates an appropriate number of columns with the same names as each of the columns in the dataset.  Additionally, it should be able to make each of these columns the same data type as the columns in the dataset.  Finally, it would be nice if, given the data in the dataset, the FlyGrid could resize the width of each column to fit the data.  I could not find any previous post on this, and as far as I can tell I think it would be possible for me to write my own function to do this stuff (just iterating through the dataset and programmatically adding columns to the FlyGrid), but I was wondering if there is already some standard way or built in functions in FlyGrid to do this.

Thanks!
Link Posted: 04-Oct-2007 09:12
There's no automatic  way to achieve the functionality you need.
So the only solution in your case is to loop though dataset fields and create appropriate flygrid columns.