Skip to content
Radu Martin edited this page Apr 15, 2017 · 18 revisions

These extenders simplify the work with data-bound in WinForms.

Usage the DataGridView:
gridView.GenerateColumns(DataSource, 
    new ColumnDataDescriptor("Header1", "Column1Name"),
    new ColumnDataDescriptor("Header2", "Column2Name"),
    new ColumnDataDescriptor("Header3", "Column3Name", FillWeight: 100));
gridView.PrepareStyleForEditingData();
gridView.AddDataRowStateDrawingInRowHeaders();
Usage the FlowLayoutPanel:
layoutPanel.GenerateGroups(DataSource, 
    new GroupDataDescriptor("GroupName1",
      new FieldDataDescriptor("Header1", "Column1Name"),
      new FieldDataDescriptor("Header2", "Column2Name")),
    new GroupDataDescriptor("GroupName2",
      new FieldDataDescriptor("Header3", "Column3Name")));
Usage the TableLayoutPanel:
layoutPanel.GenerateFields(DataSource, 
    new FieldDataDescriptor("Header1", "Column1Name"),
    new FieldDataDescriptor("Header2", "Column2Name"),
    new FieldDataDescriptor("Header3", "Column3Name"));

Supported .NET Frameworks

DataViewExtenders use special things that were introduced in .NET Framework 4.0:

  • Extension Methods (introduced in .NET Framework 3.5)
  • String.IsNullOrWhiteSpace method
  • Tuple Class