Hi I am using DataBoundGrid.
I create dataset which has two tables QueryThread and Queries.
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
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 = "";
ADAdministrator Syncfusion Team July 14, 2004 01:14 PM
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.
UMUmangiJuly 15, 2004 07:35 AM
I did the same.
DataMember was assigned to ''QueryThreads'' which was parent table.
I just called gridBinder.ResetHierarchyLevels();
and the problem was solved.