This is a migrated thread and some comments may be shown as answers.

Hierachy Grid from Objects

2 Answers 44 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Vuyiswa
Top achievements
Rank 2
Vuyiswa asked on 14 Aug 2010, 07:34 AM
Good Day All

i have Successfully binded the Schedular from Objects and its looking Good and the Following code has done that

private void BindViewer()
  {
      VS.ViewerService obj = new VS.ViewerService();
      String SessionKey = obj.newSession();
      DateTime Date1 = Convert.ToDateTime("1980-01-01");
      DateTime Date2 = Convert.ToDateTime("2012-12-31");
      VS.extract extract = obj.getObjects(SessionKey, "Butt", Date1, false, Date2, false, "", "");
      try
      {
          RadPanelBar1.Items.Clear();
          RadScheduler1.Appointments.Clear();
          int Len = extract.set.Length;
          for (int i = 0; i < Len; i++)
          {
              VS.vertex value = extract.set[i];
              String PanelClass = value.meta;
              PanelClass = PanelClass.Replace(Remstr, "");
              PanelClass = PanelClass.Replace(Remstr2, "");
              Appointment app = null;
              if (value.atom != null)
              {
                  RadPanelItem pane = RadPanelBar1.Items.FindItemByText(PanelClass);
                  if (pane == null)
                  {
                      RadPanelItem nwpane = new Telerik.Web.UI.RadPanelItem(PanelClass);
                      RadPanelItem nwpaneSpliter = new Telerik.Web.UI.RadPanelItem(PanelClass);
                      nwpaneSpliter.IsSeparator = true;
                      RadPanelBar1.Items.Add(nwpane);
                      pane = nwpane;
                  }
                  if (value.meta == "za.co.abacus.C_EVENT")
                  {
                      app = new Appointment();
                  }
                  int atomLen = value.atom.Length;
                  for (int j = 0; j < atomLen; j++)
                  {
                      VS.atom atm = value.atom[j];
                      if (atm.meta.Contains("za.co.reactor.A_LABEL"))
                      {
                          RadPanelItem NewItem = new RadPanelItem(atm.content);
                          pane.Items.Add(NewItem);
                          if (app != null)
                          {
                              app.Subject = atm.content;
                              app.Description = atm.content;
                              app.ID = value.key;
                          }
                      }
                      if (app != null && atm.meta.Contains("za.co.abacus.C_EVENT"))
                      {
                          app.ID = atm.content;
                      }
                      if (app != null && atm.meta.Contains("za.co.reactor.A_HORIZON"))
                      {
                          app.Start = Convert.ToDateTime(atm.content);
                      }
                      if (app != null && atm.meta.Contains("za.co.reactor.AA_HORIZON"))
                      {
                          app.End = Convert.ToDateTime(atm.content);
                      }
                      if (app != null && atm.meta.Contains("za.co.reactor.A_TEXT"))
                      {
                          app.Description = atm.content;
                      }
                      if (app != null && atm.meta.Contains("za.co.reactor.A_TEXT"))
                      {
                          app.RecurrenceRule = atm.content;
                      }
                      if (app != null && app.End > app.Start)
                      {
                          RadScheduler1.DataStartField = app.Start.ToString();
                          RadScheduler1.DataSubjectField = app.Subject.ToString();
                          RadScheduler1.DataEndField = app.End.ToString();
                          RadScheduler1.DataKeyField = app.ID.ToString();
                          RadScheduler1.SelectedView = SchedulerViewType.MonthView;
                          RadScheduler1.SelectedDate = app.Start;
                          SlidingZone1.ExpandedPaneId = "RadSlidingPane1";
                     
                      }
                  }
              }
          }
      }
      catch (ApplicationException ex)
      {
      }
      finally
      {
          obj.closeSession(SessionKey);
      }
  }

Now with the same results i want  to bind a Hierachy Grid as it Shows in my attached image. I am using EAV that means the is no Fixed Column name, so the Binding of the Grid Should be Dynamically. 


Thank  you

2 Answers, 1 is accepted

Sort by
0
Accepted
Pavlina
Telerik team
answered on 19 Aug 2010, 08:55 AM
Hello Vuyiswa,

To bind each detail table-view, Telerik RadGrid fires the DetailTableDataBind event. The argument carries all needed information such as the table that should be data bound, parent item(s), etc. In the code of the DetailTableDataBind event handler you should write code for constructing detail data-source (list of objects) that will be used by the table to be bound to the hierarchical structure.

Review the articles below for more information:
http://demos.telerik.com/aspnet-ajax/grid/examples/programming/detailtabledatabind/defaultcs.aspx
http://www.telerik.com/help/aspnet-ajax/grdhierarchicaldatabindingusingdetailtabledatabind.html

Greetings,
Pavlina
the Telerik team
Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items
0
Vuyiswa
Top achievements
Rank 2
answered on 19 Aug 2010, 10:31 AM
Tags
Grid
Asked by
Vuyiswa
Top achievements
Rank 2
Answers by
Pavlina
Telerik team
Vuyiswa
Top achievements
Rank 2
Share this question
or