I try to follow the example in https://demos.telerik.com/aspnet-ajax/orgchart/examples/applicationscenarios/drilldowntoviewdetails/defaultvb.aspx?show-source=true but if I run the code and click on an icon for drill-down I get the error at the line "If e.SourceNode.ID <> "1" Then":
Telerik.Web.UI.OrgChartDrillDownEventArguments.SourceNode.get returned Nothing.
The code is:
Please advise!
Thx
Gerhard
I have a large dataset of employees.
I want to load one node initially and all other node collapsed and load other node on demand.
But this control is loading complete data on page load which is making it slow.
is there any way to rebind the org chart on expand and bind all child nodes?
I would like to add a hyper link to the node of an Org Chart, and I tried to add like:
<telerik:RadOrgChart>
<ItemTemplate>
<div class="abc">
<a herf="abc.abc">test link</a>
My page logic is that I click on an 'Apply' button, then in the Apply_Click method, I do some data binding, such as: Grid1.Datasource = xxx; Grid1.DataBind(); . And the grid can show properly on the page. But when I click on other buttons on this page (for example: click the filter on the grid) to trigger a post back, the content on the grid just disappears (The datasource is stored in a session, so it's not datasource's problem). I need to add databind() to Page_Load() to prevent this from happening. But this is very weird and feels not right. Can you help me locate the real problem?
The same issue is happening bothe in Grid and OrgChart.
I read this , but when I copied the code into my own project and followed the documentation, this just didn't work. The node size and the group size are weird. No matter how I tried to edit the css settings, the height of the node just wouldn't change. Can anybody help me?
And btw I also want to ask, what do .rocItem and .rocItemContent mean? When I use my browser's inspect function, I also see a .rocItemTemplate, what is that?
So I have a organization chart and a button. When I click on the button, I will fill in a DataTable stored in ViewState to be the data source of the org chart. Since I'm still having the problem in another post that nobody replied yet: Databinding keeps disappearing when post back in UI for ASP.NET AJAX | Telerik Forums So I add some handling in Page_Load to avoid the org chart from becoming blank.
My Page logic is as follows:
<Telerik:RadButton ID="btn1" OnClick="btn_click">
...
<Telerik:RadOrgChart ID="OrgChart1">
protected DataTable table1
{
get
{
if (ViewState["table1"] != null)
return (DataTable)ViewState["table1"];
else
return null;
}
set
{
ViewState["table1"] = value;
}
}
protected DataTable table2
{
get
{
if (ViewState["table2"] != null)
return (DataTable)ViewState["table2"];
else return null;
}
set
{
ViewState["table2"] = value;
}
}
protected void Page_Load(object sender, EventArgs e)
{
if (!PostBack) // do something
if (table1 != null && table2!=null) {
OrgChart1.GroupEnabledBinding.NodeBindingSettings.DataFieldID = "aaa";
OrgChart1.GroupEnabledBinding.NodeBindingSettings.DataFieldParentID = "bbb";
OrgChart1.GroupEnabledBinding.NodeBindingSettings.DataCollapsedField = "ccc";
OrgChart1.RenderedFields.NodeFields.Add(new OrgChartRenderedField() { DataField = "A" });
OrgChart1.GroupEnabledBinding.NodeBindingSettings.DataSource = table1;
OrgChart1.GroupEnabledBinding.GroupItemBindingSettings.DataFieldNodeID = "aaa";
OrgChart1.GroupEnabledBinding.GroupItemBindingSettings.DataFieldID = "ddd";
OrgChart1.GroupEnabledBinding.GroupItemBindingSettings.DataSource = table2;
OrgChart1.DataBind();
}
}
protected void btn_click(object sender, EventArgs e) {
// do something to provide data for table1 and table2
OrgChart1.GroupEnabledBinding.NodeBindingSettings.DataFieldID = "aaa";
OrgChart1.GroupEnabledBinding.NodeBindingSettings.DataFieldParentID = "bbb";
OrgChart1.GroupEnabledBinding.NodeBindingSettings.DataCollapsedField = "ccc";
OrgChart1.RenderedFields.NodeFields.Add(new OrgChartRenderedField() { DataField = "A" });
OrgChart1.GroupEnabledBinding.NodeBindingSettings.DataSource = table1;
OrgChart1.GroupEnabledBinding.GroupItemBindingSettings.DataFieldNodeID = "aaa";
OrgChart1.GroupEnabledBinding.GroupItemBindingSettings.DataFieldID = "ddd";
OrgChart1.GroupEnabledBinding.GroupItemBindingSettings.DataSource = table2;
OrgChart1.DataBind();
}
And then, when the page is post back, suddenly there are duplicate group names in the org chart as you can see in the screenshot.
Can somebody help me?
Is there any way to sort nodes based on hierarchyid?
currently default sorting based on alphabetical order.
Thanks in advance