We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy. Image for the cookie policy date

Using DataBoundGrid in hierarchial level gives problem with Dataviewmanager

Hi I am using DataBoundGrid. I create dataset which has two tables QueryThread and Queries. ds.Tables.Add(queryThreadTable); ds.Tables.Add(queryTable); ds.Relations.Add("QueryThreadQuery",queryThreadTable.Columns["QueryThreadGuid"],queryTable.Columns["QueryThreadGuid"]); dv = new DataViewManager(ds); I set a row filter to QueryThread table dv.DataViewSettings["QueryThreads"].RowFilter = "OpenClose = ''Automatic Open''"; Now when I try following code It returns undefined value in ''queryLevel'' variable. this.gridModel = this.gridDataBoundGrid1.Model; this.gridBinder = this.gridDataBoundGrid1.Binder; // Reduce flicker this.gridDataBoundGrid1.BeginUpdate(); gridModel.Options.AllowSelection = GridSelectionFlags.AlphaBlend|GridSelectionFlags.Row|GridSelectionFlags.Column|GridSelectionFlags.Keyboard|GridSelectionFlags.Shift; gridModel.Options.AllowDragSelectedCols = false; GridStyleInfo standard = gridModel.BaseStylesMap["Standard"].StyleInfo; standard.ShowButtons = GridShowButtons.ShowCurrentRow; standard.CellType = "Static"; this.gridDataBoundGrid1.DataMember = "QueryThreads"; this.gridDataBoundGrid1.DataSource = dv; GridHierarchyLevel queryLevel = this.gridDataBoundGrid1.Binder.AddRelation("QueryThreadQuery"); So following line generates exception. queryLevel.ShowHeaders = false; Is there solution or reason why it is not returning queryLevel? I checked with data.After filtering also there are rows in QueryThread table. Evenif I change the RowFilter to "" the same problem continues dv.DataViewSettings["QueryThreads"].RowFilter = "";

2 Replies

AD Administrator Syncfusion Team July 14, 2004 05:14 PM UTC

Try setting the grid.DataMember to be the parent tables'' name instead of the child tables name (if I understand what you want there). Here is a little sample that seems to work as expected. DataViewManager_8760.zip

UM Umangi July 15, 2004 11:35 AM UTC

I did the same. DataMember was assigned to ''QueryThreads'' which was parent table. I just called gridBinder.ResetHierarchyLevels(); and the problem was solved.

Live Chat Icon For mobile
Up arrow icon