public static DataTableWrapper Create(DataTable table)
        {
            DataTableWrapper res = new DataTableWrapper();
            foreach (DataColumn col in table.Columns)
            {
                res.Columns.Add(new DataTableColumnDefinition(col.ColumnName, col.Caption, col.DataType));
            }

            foreach (DataRow row in table.Rows)
            {
                int i = 0;
                DataTableRowDefinition tableRow = new DataTableRowDefinition();
                foreach (object obj in row.ItemArray)
                {
                    tableRow.Cells.Add(new DataTableCellDefinition(res.Columns[i].Name, obj, res.Columns[i].Type));
                    if (obj == null)
                    {
                        res.Items.Add(null);
                    }
                    else
                    {
                        res.Items.Add(Convert.ToString(obj, CultureInfo.InvariantCulture));
                    }
                    i++;
                }
                res.Rows.Add(tableRow);
            }
            return res;
        }
 public void Initialize(CellInfo cell, DataTableWrapper data)
 {
     if (cell != null &&
         cell.CellDescr != null &&
         cell.CellDescr.Value != null)
     {
         txtValue.Text = cell.CellDescr.Value.DisplayValue;
     }
     else
     {
         txtValue.Text = String.Empty;
     }
     tupleCtrl.Initialize(cell);
     dataGrid.Initialize(data);
 }
 public void Initialize(DataTableWrapper data)
 {
     this.Columns.Clear();
     this.ItemsSource = null;
     
     if (data != null)
     {
         this.Columns.Clear();
         this.ItemsSource = null;
         var source = DataTable.Create(data);
         this.AutoGenerateColumns = false;
         int i = 0;
         foreach (var entry in source.Columns)
         {
             this.Columns.Add(new DataGridTextColumn() { Header = entry.Name, Binding = new Binding(String.Format("[{0}].Value", i)) });
             i++;
         }
         this.ItemsSource = source.Rows;
         this.SelectedIndex = 0;
     }
 }
		void ShowDrillthroughResult(CellInfo cell, DataTableWrapper tableWrapper)
		{
			if (tableWrapper != null)
			{
				if (m_DrillthroughDialog == null)
				{
					m_DrillthroughDialog = new ModalDialog() { Width = 600, Height = 500, DialogStyle = ModalDialogStyles.OK };
					m_DrillthroughDialog.Caption = Localization.DrillthroughDialog_Caption;
				}
				//RanetDataGrid grid = new RanetDataGrid();
				//grid.Initialize(tableWrapper);

				DrillThroughControl grid = new DrillThroughControl();
				grid.Initialize(cell, tableWrapper);
				m_DrillthroughDialog.Content = grid;
				Panel panel = GetRootPanel(this);
				if (panel != null && !panel.Children.Contains(m_DrillthroughDialog.Dialog.PopUpControl))
				{
					panel.Children.Add(m_DrillthroughDialog.Dialog.PopUpControl);
				}
				ShowDialog(m_DrillthroughDialog);
			}
		}
        void ShowDrillthroughResult(CellInfo cell, DataTableWrapper tableWrapper)
        {
            if (tableWrapper != null)
            {
                if (m_DrillthroughDialog == null)
                {
                    m_DrillthroughDialog = new ModalDialog() { Width = 600, Height = 500, DialogStyle = ModalDialogStyles.OK };
                    m_DrillthroughDialog.Caption = Localization.DrillthroughDialog_Caption;
                    m_DrillthroughDialog.DialogClosed += new EventHandler<DialogResultArgs>(Dlg_DialogClosed);
                }
                //RanetDataGrid grid = new RanetDataGrid();
                //grid.Initialize(tableWrapper);

                DrillThroughControl grid = new DrillThroughControl();
                grid.Initialize(cell, tableWrapper);
                m_DrillthroughDialog.Content = grid;
                Panel panel = GetRootPanel(this);
                if (panel != null && !panel.Children.Contains(m_DrillthroughDialog.Dialog.PopUpControl))
                {
                    panel.Children.Add(m_DrillthroughDialog.Dialog.PopUpControl);
                }
                // На время убираем контекстное меню сводной таблицы
                PivotGrid.UseContextMenu = false;
                m_DrillthroughDialog.Show();
            }
        }