How can get its properties as: Name of columns, count of row, count of column, value of each cell
I have a combobox symbol
I can declare it in code behind, but I don’t know how to using its event properties. I want to type code inside its event properties.
Please help me
Best
In what table exactly do you want to get this informations from? Can you please send us a print screen?
As you know, we also have informations about the DataGrid in the following link:
You can declare it in CodeBehind like this, then you can use the method you want, what code do you want to type inside the property, can you please provide us an example?
Alarm window object was shown in Runtime mode like a table ( contain columns and rows)
How can I get value a specific cell in window object. Please see picture
2. The picture of post is mine. As I mentioned, I could declare TcomboBox in code behind.
I could also use its method and properties inside public void.
But I don’t know how you the its event.
Best
In this case, @Tag.text will get the value of cell(0,20).
Keep in mind that the column index used in “columnSelect”, is according to the AlarmWindow Configuration page.
The ComboBox object works as a “class” in C#, its events are represented by the lightning symbol:
If you want to handle ComboBox events, you have to associate an event handling method with the event.
In this example below, we are associating the “SelectionChanged” event with its handler:
Then you have to write the code you want to be executed when the event occurs:
Dear expert
Thank for your useful feedback. I got your explanation.
I have a small doubt when declare ComboBox with instruction " TComboBox Combo = CurrentDisplay.GetControl(“cobox”) as TComboBox"*
If I put this instruction inside the public void method, no error happen.
If I put this instruction outside the public void method, the error happen like below pictue
In the following explanation we will show you how to create a global ComboBox declaration. We will declare the variable Combo and Combo2 as of type TComboBox. The function InitializeCombo is then created, which aims to initialize the variable Combo and Combo2. In DisplayIsOpening, the function called InitializeCombo is executed to initialize the Combo and Combo2 variables and we did this example adding the values “123” and “abc”. In this way, the values are already inserted in the ComboBox.
public TComboBox Combo;
public TComboBox Combo2;
public void InitializeCombo()
{
Combo = CurrentDisplay.GetControl("cobox") as TComboBox;
}
public void InitializeCombo2()
{
Combo2 = CurrentDisplay.GetControl("Combo") as TComboBox;
}
public void DisplayOpening()
{
InitializeCombo();
Combo.Items.Add("abc");
InitializeCombo2();
Combo2.Items.Add("123");
}
Outside of methods , you can only declare variables, to execute the GetControl() must be into a methods DisplayOpening, DispayIsOpen, DisplayClosing or any other methods called by those three methods.
Dear Sir/Madam
I also have the same problem.
In my project, I have a combobox and tag which assinged vaule into combobox.
I created the SelectionChanged Event for this combox.
But I release, after this event perform finished, the tag received the current valued of combobox.
Are there any other event of combobox, after the tag received the current valued of combobox, the event occur next. Because, I need to use value of tag in event.
Please help me.
Best
We want to ensure we fully understand your question. Are you asking if there is a ComboBox event that is triggered when a tag receives a value from the ComboBox?
To better assist you, it would be helpful if you could provide us with additional details regarding your project’s specific requirements. This will enable us to offer you the most optimal solution.
At the Code be hind. I declared Combobox, and defined query statement ( Query Statement contains
Value of SelectedItem of Combobox) in event of Combobox as below picture
contains.
Thank you for clarifying your question. We have carefully reviewed your query and successfully reproduced the reported behavior in our system.
To ensure that the Tag assigned to combo.SelectedItem is updated in the correct order, we recommend making the following modification in the CodeBehind:
public void handler(object sender,SelectionChangedEventArgs e)
{
@Tag.combox=this.combo.SelectedItem.ToString();
@Dataset.Query.QueryT.SqlStatement="SELECT * FROM "+@Tag.combox;
}
By implementing this change, we were able to achieve the desired final result, as you explained.