I am trying to implement a datatable which should have the childnodes listed as table rows with 2 other page properties - last updated and theme. I am really struggling to understand how this works. I have some of a .cs I needs help with completing it, I also need to know where the corresponding ascx.cs file goes and then how I reference the above files so it shows of the page.
using System;
using System.Collections.Generic;
using System.Data;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
public partial class Practice : System.Web.UI.UserControl
DataTable dt = new DataTable("myDataTable");
dt.Columns.Add("col1")
DataRow = dt.NewRow();
foreach(Node n in nyNodes.Children){
row["col1"] = document.GetProperty("foo").Value;
dt.Rows.Add(row);
}
myGridview.DataSource = dt;
myGridview.DataBind();
umbraco.presentation.nodeFactory.Node nodeB = new umbraco.presentation.nodeFactory.Node(nodeNum);
foreach (umbraco.presentation.nodeFactory.Node childNode in nodeB.Children)
{
int id = childNode.Id;
Document doc = new Document(id);
}
Data tables/Grid view
Hi there
I am trying to implement a datatable which should have the childnodes listed as table rows with 2 other page properties - last updated and theme. I am really struggling to understand how this works. I have some of a .cs I needs help with completing it, I also need to know where the corresponding ascx.cs file goes and then how I reference the above files so it shows of the page.
Please help.
Thanks in advance Natasha
Hello,
What version of Umbraco are you using? This code seems for Umbraco 6. In Umbraco 7 this doesn't work anymore. This blog might help: http://24days.in/umbraco/2015/custom-listview/
Jeroen
Hi Jeroen
I am using version 6.1.6. I can't seem to find any information anywhere about it.
Thanks Natasha
Hi Natasha
Try this to fetch data
hope this help
Regards
Samira
is working on a reply...