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

Adding row in hierarchial grid.

Hi I am using hierarchial grid. I bind it to data set with two tables gridDataBoundGrid1.DataMember = "QueryThreads"; gridDataBoundGrid1.DataSource = ds; gridModel.Options.AllowSelection = GridSelectionFlags.AlphaBlend|GridSelectionFlags.Row|GridSelectionFlags.Keyboard|GridSelectionFlags.Shift; GridStyleInfo standard = gridModel.BaseStylesMap["Standard"].StyleInfo; standard.ShowButtons = GridShowButtons.ShowCurrentRow; standard.CellType = "Static"; // cache grid model and binder // Reduce flicker GridHierarchyLevel queryLevel = gridDataBoundGrid1.Binder.AddRelation("QueryThreadQuery"); on button click in child table I add a row DataTable queryTable = ds.Tables["Queries"]; DataRow qRow = queryTable.NewRow(); qRow["QueryThreadGuid"] = query.QueryThreadGuid; qRow["QueryGuid"] = query.QueryGuid; qRow["CreationReason"] = query.CreationReason; qRow["EndUser"] = query.EndUserName; qRow["Created"] = query.Created.ToShortDateString(); qRow["FieldName"] = query.FieldName; qRow["SubjectInitials"] = query.SubjectInitials; qRow["VisitName"] = query.VisitName; qRow["FormName"] = query.FormName; qRow["Screening"]= query.ScreeningNumber; qRow["Unread"]=false; queryTable.Rows.Add(qRow); to show the new row in grid I call Update() function of grid but still new row is not displayed Thanks in advance

5 Replies

AD Administrator Syncfusion Team August 17, 2004 12:34 PM UTC

To get a new row added to the child gird to display, you will have to open and close the parent node. Take a look at the threads listed in this previous post. They contain samples. http://www.syncfusion.com/Support/Forums/message.aspx?MessageID=17790


UM Umangi August 17, 2004 12:44 PM UTC

Clay Thanks for reply I saw those samples but for them if they collapse and expand the parent node the row gets displayed. but not in my case . do you know any reason ? >To get a new row added to the child gird to display, you will have to open and close the parent node. > >Take a look at the threads listed in this previous post. They contain samples. > >http://www.syncfusion.com/Support/Forums/message.aspx?MessageID=17790


AD Administrator Syncfusion Team August 17, 2004 12:52 PM UTC

Is queryTable the child table or the parent table? If it is the parent table, try calling grid.Refresh(). If it is the child table, then I think opening and closing the parent node should display it. In this case, if you physically click the parent node to close it, and then click it again to re-open it, does the new row appear?


AD Administrator Syncfusion Team August 17, 2004 12:54 PM UTC

yes physically clicking to collapse and expand does not show the new row


AD Administrator Syncfusion Team August 17, 2004 12:58 PM UTC

The only thing I can think of is that the contraint that puts a row into this particular child table is not being satisfied. (Is the parent relation value in the row the correct one to place it in the current parent?) If you can attach a sample project showing the problem, we can try to spot something here?

Loader.
Live Chat Icon For mobile
Up arrow icon