Bind GridView to Hierarchical with XML Data Source
The Kettic DataGridView Control does not support the data binding to XML directly, but accomplish data binding to XML through DataTables. Users of the Kettic DataGridView component are able to create DataSet and DataTables from an XML document. The following is a XML file used in data binding for GridView control. The Kettic DataGridView is not capable of many-to-many relations, which may be included in the DataTables created by XML files. Create Hierarchy with XML Data Source
To bind GridView component to XML, we need to create a DataSet instance from the xml file first. In the example of binding GridView to XML, there is only a single DataTable which is set as the data source of Kettic GridView control. It is also possible to bind GridView to hierarchy data of XML file, which is available on binding to hierarchy data. The following is the XML file that will be used in binding to hierarchy data.
And now, we can use the xml file to create hierarchical data binding for Kettic GridView. In the DataSet we created above, there are three tables in the XML file, however, users can ignore the second one and use the first and third ones only. The ReadXml method will automatically add the Order_Id and Product_Id columns to the created tables. The following is the C# code demonstrating the process of creating hierarchical binding to XML data for GridView control.
|
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 MenuGridView - Populating with DataGridView - Hierarchical GridData Binding AutomaticallyData Binding ProgrammaticallyXML Data SourceResize Child GridVieInfoOne to Many RelationsExpand RowsGridView - SelectionBasic SelectionMultiple SelectionProgrammatical Rows & Cells Selection GridView - ScrollingGridView - SortingSet ProgrammaticallySorting ExpressionsGridView - 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 |