select data from combobox and show the id in label c# - select

I have a combo box with nationality Text I want to show the selected value id of the nationality in the label.text
I did it this way
lblNathonality.text=comboBox1.SelectedItem.ToString();
could someone tell me what is wrong here ?????!!!!
I'm lost it did not work and I do not know how to fix this problem could someone write the code in Linq please help I can't solve it !!!!!!!!!

Try SelectedValue instead of SelectedItem.
lblNathonality.text= Convert.ToString(comboBox1.SelectedValue);

Related

Title of crystal report- can concatinate?

I wanted to find out if there is a possibility to concatenate parameters for the title?
for example:
i have parameter of sysdate and my title of the report is Chani Test i want to see in the title
Chani Test 6.11.2018
is it possible?
I waiting for your answer
regards,
If I understand correctly, you can add a textbox and place it where you want the title to show (Remove current title). Then in the textbox type 'Chani Test', add a space and finally drag you sysdate parameter inside the textbox along with the title you just typed
In the image below, you can see the edges of the textbox and my text inside it. Please ignore my Year parameter.
.

How to get the content in the table within a CVirtualGridCtrl control of a window through pywinauto

I am trying to get the content of a table within a GridCtrl control as shown in the screenshot below.
I have found through spy++ that the control containing the table is CVirtualGridCtrl.
But how can I get the content of the table?
app = pywinauto.Application().Connect(path = "xiadan.exe")
control = app[u'网上股票交易系统5.0'].CVirtualGridCtrl
control.PrintControlIdentifiers()
If I run the above code, I will get the following output:
Having searched and test for a long time, I still have no clue.
Could someone kindly give me a hint? Thanks a lot.
Edit:
Really appreciate your quick response #vasily-ryabov. I have tried as you suggested, unfortunately there is no recognizable control to get the numbers I want.
Does this mean that it is then impossible to get the content of the cells?
I have also tried right clicked on the control, but there is no interested short-cut operation.
You can try to use clipboard to get grid data.
control.type_keys('^A^C')
data = pywinauto.clipboard.GetData()

Max date available in data to title

I wanna put the latest date available in my data to the title. I created a calculated fild max(date). However, it's stuck in measures and not available in the menu when I choose insert in the Title menu.
Any other ideas how to handle this? Thanks!
With this approach I assume that you wanted to add last refreshed datetime to Title. If yes, then you just need to double click on Title and then in Edit Title window click on 'Insert' to select Data Update Time. Content of Edit Title box can be like -
<Sheet Name> refreshed at <Data Update Time>
Now to answer your specific question - I would recommend to create a calculated field max_date as lookup(max([Date]),0) and drag it to 'Detail' Marks. Right click it and select MDY format. After this you should have max_date field in 'Insert' option of Edit Title box. Hope this helps!
Don't forget to let us know if it solved your problem :)
What actually helped to solve the problem is to use LOD. So my calculated field now looks like: {FIXED: MAX(date) }
To get the max date from your dataset you'll want to avoid using FIXED, INCLUDE, or EXCLUDE. The curly braces by themselves will get you what you're after.
Add that calculation to the detail shelf of the marks card so it's available to you in the title.
Once selected you'll see the max date of your dataset in the title.
Remember, it won't be available until you add it to your view.
Hope that helps!
Make another calculated field to convert your MAX date into a string:
STR([Calculation1])
Then you'll be able to add this field to your worksheet title.
In my case this issue came up when working on a dashboard and none of the other answers helped.
Create a new worksheet to use as the title in your dashboard.
In the new worksheet, create a new calculation Max([Date]) and drag it to the Text mark. Then click the Text mark and then click the ellipses, and insert the Max([Date]) into your title. Then make sure to hide your worksheet's title by clicking the 'More Options' arrow and clicking 'Title'.
Here is a tutorial to help illustrate.

Tooltip on combox Item

I want a tool tip on the drop down list for combox items. I have a combobox and showing combobox item in that combobox on selected index change of drop down, but it is note helping me too much.
Since my dropdown size is small, and items in the dropdown are very big, it's become difficult for users to select the proper value by seeing this.
If tooltip shown on the individual item, it could be very useful.
If any budy knows answer , Please reply.
Use the ToolTip class for this. An example in code would be:
ToolTip toolTip = new ToolTip();
toolTip.Show(comboBox1.SelectedItem.ToString(), comboBox1);
You can then tie this code to the comboBox1_SelectedIndexChanged event handler.
NOTE: Your ComboBox name may differ from mine.

Smart GWT how to select item in ComboBoxItem

I have what seems like it should be a really simple problem, but somehow it is not. SmartGwt has a way of taking something easy and making it overly complicated!
I have a ComboBoxItem populated by a LinkedHashMap. All I want to do is to be able to programmatically select a row/value to display. In plain GWT, this would be something like:
listBox.setSelected(1)
I have searched and searched, and I have come up empty. Please someone help!!!
Suppose your map has values like
items.put(1,"a");
items.put(2,"b");
ComboBoxItem listBox = new ComboBoxItem();
listBox.setValueMap(items);
Then
listBox.setValue(1) will display "a" in listBox
listBox.setvalue(2) will display "b" in listBox
You Can set value's for drop down in Combobox item through setValuMap(String array[])
String []valueMap = {"A","B"};
comboBoxItem.setValueMap(valueMap);
this will set the value in string array to combox box. You can set value programmatically through setValue(String value) function.
comboBoxItem.setValue("A");
http://www.smartclient.com/smartgwt/javadoc/com/smartgwt/client/widgets/form/fields/ComboBoxItem.html