Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. General Programming
  3. Visual Basic
  4. Exception in datagrid when bound to related view

Exception in datagrid when bound to related view

Scheduled Pinned Locked Moved Visual Basic
csshelp
1 Posts 1 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • T Offline
    T Offline
    thebread
    wrote on last edited by
    #1

    hey all, i have a dataset with three related tables in it. Table_1 -> 1-n Table_2 -> 1-n -> Table_3 I build a treeview with Table_1 and show the related rows of Table_2 in a Datagrid (grid_1). By selecting a row in the grid i show the details of that row and all related rows of Table_3 in another grid (grid_2). If i use perfmon to watch all exceptions of my application i get 5 Exceptions each time i select another node in the treeview (each node represents a datarow of Table_1). If I don't assign the second grid with a datasource (in my case a dataview of Table_1) i get no exceptions. The difference between grid_1 and grid_2 is the assignment of the datasource. The datasource of grid_1 will be assigned in the AfterNodeSelected event of the treeview after positioning the currencymanager tho the right position. the datasource of grid_2 will be assigned at initialization time. Private Sub trvProducts_AfterSelect(ByVal sender As Object, ByVal e As System.Windows.Forms.TreeViewEventArgs) Handles trvProducts.AfterSelect If Not Me.trvProducts.SelectedNode Is Nothing Then Dim i As Integer = Me.NavigationView.Find(CType(Me.trvProducts.SelectedNode.Tag, Product.Model.dsProduct.tblProductGroupRow).ID) Me.Grid_1.SuspendLayout() Me.Grid_1.DataMember = "" Me.Grid_1.DataSource = Nothing cmGroup.Position = i Me.Grid_1.DataMember = "tblProductGrouptblProduct" Me.Grid_1.DataSource = NavigationView Me.Grid_1.Refresh() Me.Grid_1.ResumeLayout(True) End If End Sub public Sub New() [...] NavigationView.Table = Me.Dataset.Table_1 Me.Grid_2.DataMember = "tblProductGrouptblProduct.tblProducttblProductPrice" Me.Grid_2.DataSource = NavigationView End Sub Please Help !! cheers, Bernd

    1 Reply Last reply
    0
    Reply
    • Reply as topic
    Log in to reply
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes


    • Login

    • Don't have an account? Register

    • Login or register to search.
    • First post
      Last post
    0
    • Categories
    • Recent
    • Tags
    • Popular
    • World
    • Users
    • Groups