Symbol object in display

Dear Expert.
I’m using Factorystudi for my project.
I have 2 issue with Object in software as following

  1. With BarChart Object.
  • The its Datasoure is query of Dataset
  • The Barchart work OK but I can’t hide 0 value away Bartchart.
  • How can I do that?
  1. With DataGrid Window
    How can I scroll Data of DataGrid Window in to last.
    Example, After 1 second, I add a new row into Datagrid Window. With size of Datagrid Window on screen, it can onle show 10 row. I want to Datagrid automatically scroll into 10 last row.
    Best

Hi Thanos,

Regarding the configuration of the BarChart object, we recommend the following approach to prevent the display of zero values:

1. Assign the Query results to a Tag though script.
2. Create a script that deletes all zero values from the Tag.
3. Assign the Tag as Data Source on the BarChart.

Below is a script example to delete all zero values and assign the result to “@tag.tabletag”:

DataTable dt=@Dataset.Query.Query1.SelectCommand();
       foreach (DataRow row in dt.Rows)
        {
            if (row[0].ToString()=="0")
            {
                row.Delete();
            }
        }
@tag.tabletag=dt;

By implementing these steps, you can ensure that zero values are not displayed on the BarChart.

Now, regarding the automatic scroll feature for the DataGrid Window in your project, you can achieve this by following the steps below:

To make your project’s DataGrid Window automatically scroll to the last items added, follow these steps:

Create an EventHandler method in the CodeBehind of your display. This method will be responsible for selecting the last added item in the DataGrid.

private void scroll(object sender, System.EventArgs e)
{
TDataGridWindow grid=this.CurrentDisplay.GetDataGrid("grid") as TDataGridWindow;
Xceed.Wpf.DataGrid.DataGridControl dg = grid.GridControl.DataGridObj;
dg.SelectedIndex=dg.Items.Count-1;
dg.Items.MoveCurrentToLast();	
}

After creating the EventHandler method, assign it to the “AfterInitilizationEvent” event of the DataGrid. This ensures that the event handler is triggered every time the DataGrid is updated.

public void DisplayIsOpen()
{
TDataGridWindow grid=this.CurrentDisplay.GetDataGrid("grid") as TDataGridWindow;
Xceed.Wpf.DataGrid.DataGridControl dg=grid.GridControl.DataGridObj;
grid.AfterInitilizationEvent+=scroll;
grid.DoRefresh();
}

Please note that these steps are specific to a DataGrid Window with the control name “grid.” Make sure to modify the code to match the control name used in your project.

If you have any further questions or need assistance with any other issues, please let us know.

Best Regards,
Tatsoft Team.

Dear Expert
Thank for your Support.
I will try this solution
Best