Hi all
i have class that return datatable when i bind to treeview i got this error
This constraint cannot be enabled as not all values have corresponding parent values
and this is stack
ArgumentException: This constraint cannot be enabled as not all values have corresponding parent values.]
System.Data.ConstraintCollection.Add(Constraint constraint, Boolean addUniqueWhenAddingForeign) +502
System.Data.DataSetRelationCollection.AddCore(DataRelation relation) +1069
System.Data.DataRelationCollection.Add(DataRelation relation) +138
System.Data.DataRelationCollection.Add(DataColumn parentColumn, DataColumn childColumn) +43
Telerik.Web.UI.ControlDataBinder.BindToDataTable(DataTable data, String dataFieldID, String dataFieldParentID) +150
Telerik.Web.UI.HierarchicalControlItemContainer.PerformDataBinding(IEnumerable data) +447
System.Web.UI.WebControls.DataBoundControl.OnDataSourceViewSelectCallback(IEnumerable data) +111
System.Web.UI.DataSourceView.Select(DataSourceSelectArguments arguments, DataSourceViewSelectCallback callback) +29
System.Web.UI.WebControls.DataBoundControl.PerformSelect() +149
System.Web.UI.WebControls.BaseDataBoundControl.DataBind() +70
BNIS.FundMarket.Web.GL.ChartOfAccount.Page_Load(Object sender, EventArgs e) in C:\Projects\FundMarket\BNIS.FundMarket.Web\GL\ChartOfAccount.aspx.cs:31
System.Web.Util.CalliHelper.EventArgFunctionCaller(IntPtr fp, Object o, Object t, EventArgs e) +15
System.Web.Util.CalliEventHandlerDelegateProxy.Callback(Object sender, EventArgs e) +33
System.Web.UI.Control.OnLoad(EventArgs e) +99
System.Web.UI.Control.LoadRecursive() +47
System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +1436
and this is cod from page load
DataTable
dt = BL.GL.mm();
tvChartOfAccount.DataSource = dt;
tvChartOfAccount.DataFieldID = dt.Columns[
"AccountNo"].ColumnName;
tvChartOfAccount.DataFieldParentID = dt.Columns[
"ParentAccountNo"].ColumnName;
tvChartOfAccount.DataTextField = dt.Columns[
"ENAccountName"].ColumnName;
tvChartOfAccount.DataBind();
what is that error ?