Home - Forums-.NET - FlyGrid.Net (Windows Forms) - VB.Net: Additional samples

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

VB.Net: Additional samples
Link Posted: 02-Nov-2005 07:53
This thread contains additional VB.Net samples.
Link Posted: 02-Nov-2005 07:59
This VB.Net sample show how to bind to LookupListColumn and use this column with FlyGrid.Net
Sample can be downloaded here
Link Posted: 02-Nov-2005 08:00
This VB.Net sample shows how to implement custom list of values for dropdowns in the columns.
Link Posted: 02-Nov-2005 08:01
This sample shows how to initialize FlyGrid to display and edit simple 2-dimensional array of data.
Link Posted: 11-Nov-2005 04:36
This VB.Net sample shows how to delete multiple rows from bound FlyGrid
Link Posted: 06-Mar-2006 11:34
This VB.Net sample  shows how to fill FlyGrid column cells with different types of data and edit data with support of inplace editors (checked list, dropdown list, numeric data types).
Link Posted: 07-Mar-2006 13:33
This VB.Net sample  shows how to fill FlyGrid column cells with different types of data and edit data with support of inplace editors (checked list, dropdown list, numeric data types).
Also this sample shows how to use UITypeEditor and TypeConverter to provide dynamic dropdowns to edit data in the cell.
Link Posted: 08-Mar-2006 18:53
This code sample shows how to organize text search in FlyGrid:
[VB.Net]
    Public Class SearchData
      Public FoundCol As Integer
      Public FoundNode As NodeBase
      Public ReadOnly SearchText As String
      Public Sub New(ByVal searchString As String)
        Me.SearchText = searchString
      End Sub
    End Class

    Private Function Find(ByVal nodes As NodeCollection, ByVal data As SearchData) As Boolean
      If (Not nodes Is Nothing) Then
        For Each child As NodeBase In nodes
          Dim val As Object() = child.Value
          If (Not val Is Nothing) Then
            For i As Integer = 0 To val.Length - 1
              Dim cellValue As String = val.GetValue(i)
              If (Not cellValue Is Nothing And cellValue.Equals(data.SearchText)) Then
                data.FoundNode = child
                data.FoundCol = i
                Return True
              End If
            Next
          End If
          If (child.HasChildren) Then
            If Find(child.Items, data) Then
              Return True
            End If
          End If
        Next
      End If
      Return False
    End Function

    Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
      Dim data As SearchData = New SearchData("Nested4")
      If (Find(flyGrid.Rows.Items, data)) Then
        flyGrid.Selected = data.FoundNode
      End If
    End Sub
Link Posted: 08-Mar-2006 19:00
This code snippet shows how to enumerate all nodes in FlyGrid:
[VB.Net]
    '---------------------------------------------------------------------------------
    ' enumerate nodes by using INodeNavigation interface methods
    ' implemented on NodeBase
    '---------------------------------------------------------------------------------
    Private Function EnumerateNodesUsingNodeNavigation(ByVal node As NodeBase) As Integer
      Dim nav As INodeNavigation = node.GetFirst()
      Dim res As Integer = 0
      While (Not nav Is Nothing)
        res += 1
        nav = nav.GetNext()
      End While
      Return res
    End Function
    '---------------------------------------------------------------------------------
    ' enumerate nodes by using HasChilren, NodeBase.Items and recursion
    '---------------------------------------------------------------------------------
    Private Function EnumerateNodes(ByVal node As NodeBase) As Integer
      Dim res As Integer = 0
      If (node.HasChildren And Not node.Items Is Nothing) Then
        For Each child As NodeBase In node.Items
          res = res + EnumerateNodes(child) + 1
        Next
      End If
      Return res
    End Function

    Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
      'trying the first way
      Debug.WriteLine("Nodes Count (1):" + EnumerateNodes(flyGrid.Rows.RootNode).ToString())
      'trying the second way
      Debug.WriteLine("Nodes Count (2):" + EnumerateNodesUsingNodeNavigation(flyGrid.Rows.RootNode).ToString())
    End Sub
Link Posted: 26-May-2006 04:14
This VB.Net sample shows how to fast and easy implement Master/Detail with FlyGrid.