GridView Data Binding to BindingList
The BindingList is a generic list type. The Kettic DataGridView component is capable of binding to Generic Lists. The BindingList provides additional binding support to Generic List. When we are going to bind the GridView component to a generic list, the BindingList will offers additional control over list items to edit, remove or add. The BindingList also surfaces C# events notifying users of GridView as any changes happened to the Bindinglist.
How to Bind GridView to BindingList
In the example showing as following, we are going to create a MyObject list, initializing the BindingList and assigning the BindingList to the DataSource property of the GridView control. We are going to use the ListChangedEventHandler in the example below to report the type changes occurring, the item new index and content.
C# code for creating C# class for binding GridView .NET component to BindingList
C# code for binding GridView .NET component to BindingList to BindingList
|
UI Controlsfor Windows Forms .NET WinForms UI Overview.NET WinForms UI Features.NET WinForms UI GuideC# WinForms UI DesignVB.NET WinForms UI DesignWinForms UI Controls WinForms Buttons UI Control WinForms Calendar UI ControlWinForms Carousel UI ControlWinForms Chart UI ControlWinForms Clock UI ControlCommandBar UI ControlWinForms Dock UI ControlDesktop Alert UI ControlDropDown List UI ControlWinForms Editor UI ControlForms and Dialogs UI ControlWinForms GridView UI ControlGridView - Get Started in C#GridView - PropertiesGridView - ColumnGridView - RowGridView - CellsGridView - EditorsGridView - Context MenuConditional Custom Context MenuModify Default Context MenuGridView - Populating with DataData BindingBinding to Array and ArrayListBinding to Generic ListBinding to Binding ListBinding to DataTable / DataSetBinding to DataReaderBinding to Sub ObjectsBinding to XMLUnbound ModeUpdate DatabaseGridView - Hierarchical GridGridView - SelectionGridView - ScrollingGridView - SortingGridView - GroupingGridView - FilteringGridView - Expression EditorInsert/ Update/ Delete RecordsGridView - View DefinitionGridView - Exporting DataStyling and AppearanceGridView - LocalizationSave and Load LayoutGridView - Print SupportWinForms ListView UI ControlWinForms Menu UI ControlWinForms ComboBox UI ControlWinForms PageView UI ControlPanels and Labels UI ControlWinForms Panorama UI ControlWinForms PDFViewer UI ControlWinForms Property Grid UI ControlWinForms Ribbon UI ControlWinForms PivotGrid UI ControlWinForms RichTextBox UI ControlWinForms Rotator UI ControlWinForms Scheduler UI ControlWinForms Shortcuts UI ControlWinForms SpellChecker UI ControlWinForms Track & Status UI ControlWinForms TreeView UI ControlWinForms Wizard UI ControlWinForms Test UI ControlWinForms Theme UI Control |