I use real mode
Dim data As Object()
data = New Object() {objKorisnik.Ime, objKorisnik.Prezime, objKorisnik.Odjel, objKorisnik.Ured, objKorisnik.Limit, objKorisnik.Point, objKorisnik.Mobitel, objKorisnik.ID}
Dim n As NodeBase = AddNestedTo(gridKorisnici.Rows.Items, data)
AddItemsTo(n.Items, objKorisnik.ID)
Private Sub AddItemsTo(ByVal nodes As NodeCollection, ByVal id As Long)
Dim veza As New Veza
Dim objVeze As VezaCollection = veza.GetInfo(id)
Dim objVeza As Veza
For Each objVeza In objVeze
If objVeza.Broj 0 Then
Dim data As Object()
data = New Object() {Format(CInt(objVeza.Broj), "0000000000"), Format(objVeza.Aktivirano, "dd.MM.yyyy"), IIf(objVeza.Suspendirano.Year = 1, String.Empty, Format(objVeza.Suspendirano, "dd.MM.yyyy")), objVeza.VezaID}
nodes.Add(New Node(Data))
End If
If Not objVeze Is Nothing Then objVeze = Nothing
Next
End Sub
Private Function AddNestedTo(ByVal nodes As NodeCollection, ByVal obj As Object) As NodeBase
Dim nested As NodeBase = New NestedGridNode
nested.Value = obj
nodes.Add(nested)
Return nested
End Function
but i use the Find function ti search only items in column(1).
In fact i just noticed that the Find function is not causing the problem but the application hangs when i press F to put focus in my Textbox (in gridKorisnici_KeyDown Handler). It does not produce errors, it just suddenly takes all the CPU usage and i can't do anything but force close it. Further more when i DON'T use nested grids, all this works wihtout any problem.
Private Sub gridKorisnici_KeyDown(ByVal sender As Object, ByVal e As System.Windows.Forms.KeyEventArgs) Handles gridKorisnici.KeyDown
If e.KeyCode = Keys.F5 Then LoadKorisnici()
If e.KeyCode = Keys.Enter Then IzmjeniKorisnika()
If e.KeyCode = Keys.Delete Then btnObrisi_Click(Nothing, Nothing)
If e.Control = True And e.KeyCode = Keys.A Then gridKorisnici.Rows.SelectAll()
If e.KeyCode = Keys.F Then
txtFind.Focus()
txtFind.SelectAll()
End If
End Sub