Using DatagridWindow Object at CodeBehind wworkspace

Dear expert
In my project, I create a DataGridWindow Object at Display and using it at CodeBehind
I decleared successfully DataGridWindow Object at CodeBehind ( see below Picture). But I didn’t the its method for following:

  1. Get the count of Columns
  2. Get the count of Rows
  3. Get the name of each Column
  4. Get Value of each Cell
    PLease support me this issue
    Best.

Hi Manh,

You can use this codes to do what you want:

For number 4, there is a property you can use in DataGridWindow:

ps: Lines Count property in DataGridWindow also counts the row numbers.

Does it help you?

Bests,
Tatsoft Team.

Dear Sir
Thank for your useful support.
the issue 1,2,3 was clear
about issue 4, I need get value of cell in Codebehind like Cell [1,1].
Best

Hi Manh,

In this case you can use the following code:

public void MouseLeftButtonDown1(object sender, System.Windows.Input.InputEventArgs e)
{
	TDataGridWindow grid = this.CurrentDisplay.GetDataGrid("grid");	
	
	int rowSelect = 7;
	int columnSelect = 1;
	
	Xceed.Wpf.DataGrid.DataRow row = (Xceed.Wpf.DataGrid.DataRow)grid.GridControl.DataGridObj.GetContainerFromIndex(rowSelect);
	@Tag.text = row.Cells[columnSelect].Content.ToString();

}

@Tag.text will get the value from cell (7,1).

Bests,
Tatsoft Team.

Dear Sir
Thank for support.
It worked well
Best