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.