public ChartOfAccountsScreenViewModel(int costcenterID, int companyindex, int userID)
        {
            CostCenterID = costcenterID;
            Companyindex = companyindex;
            UserID = userID;

            Dataset = new Ptree().GetCostCenterGridViewList(Companyindex, CostCenterID, UserID);

            #region Commented

            //System.Xml.XmlDocument xDoc = new System.Xml.XmlDocument();

            //xDoc.LoadXml(dt.Rows[0]["TreeXML"].ToString());

            //System.Xml.XmlNodeList xList = xDoc.SelectNodes("GridXML/Columns/TreeColumn");
            //Columns = new ObservableCollection<ColumnDescriptor>();

            //for (short i = 0; i < xList.Count; i++)
            //{

            //    TreeColumn objPColumn = (TreeColumn)PACTSerializer.FromXml(xList[i].OuterXml, typeof(TreeColumn));

            //    if (i == 0)
            //        strCols = objPColumn.Name;
            //    else
            //        strCols = strCols + "," + objPColumn.Name;
            //    //
            //    Columns.Add(new ColumnDescriptor() { align = objPColumn.Allignment, width = objPColumn.Width, HeaderText = objPColumn.Label, DisplayMember = "Field" + (i + 1).ToString() });
            //}
            #endregion

            DynamicCommand = new DelegateCommand<string>(CommandController);
            CMenu = new List<string>();
            CMenu.Add("Add");
            CMenu.Add("Edit");
            CMenu.Add("Move");
            CMenu.Add("delete");

            GroupItemColor = Colors.Black;
            ItemColor = Colors.Gray;
            SelectedItemColor = Colors.Green;
            MovingItemColor = Colors.Red;
        }
 void process_DoWork(object sender, DoWorkEventArgs e)
 {
     for (int i = 1; i <= RowCount / 1000; i++)
     {
         DataTable dt = new Ptree().GetCostCenterSummary(Companyindex, GridViewID, strCols, i * 1000, 1000).Tables[0];
         Data.Merge(dt, true, MissingSchemaAction.Add);
         TempData = dt;
     }
 }
        void GetData()
        {
            DataSet ds = new Ptree().GetCostCenterSummary(Companyindex, GridViewID, strCols, -1, 1001);
            Data = ds.Tables[0];

            RowCount = Convert.ToInt32(ds.Tables[1].Rows[0][0]);

            BackgroundWorker process = new BackgroundWorker();
            process.DoWork += new DoWorkEventHandler(process_DoWork);
            process.RunWorkerAsync();
            TempData = Data;
        }