In WPF I need to have UI like below without code behind. The question will vary for each customer. Question & answer is configurable and it should be loaded dynamically from the database. I require help on how to achieve the problem. I am new to WPF.
CustomerID Customer Name Question Answers Types
1001 XYZ Customer Sex? o Male o Female o Other Radio button
1002 ABC Customer Sex? o Male o Female o Other Radio button
Movie Type? [] Type 1 [] Type 2 [] Type 3 Checkbox
1003 QWE Enter the description Plain TextBox Textbox
Select Any one List Listbox/ combobox
Related
I'm working on a wpf application that display a datagrid with 7 columns:
ID, Value1,Value2,Value3,Value4,Value5,Total. ID and Total are not editable form the user, only the other. Once the user have clicked on one cell and change it (only 0 and 1 allowed), I'd like that when he press 1 or 0 the value is entered and commited going to the next editable cell,(that can be also in the next row.
Is there a way to do that in wpf?
You may try CellEndEdit event and put your calculateTotal method there.
enter image description here
I'm trying to display data in devexpress grid control. I have a column called gender that takes bit values. I want to display the data that when its 1 the cell show Female and when its 0 the cell show male.
just add columEditItem and set it to lookUpEdit.
Add in lookUpEdit two items the first with text male having a value true and the second with text female having a value false.
Set the column to readOnly
So,whenever the value is true it will shows male and same for female on false
hope this helps you.
feel free to ask any question
I have a grid with 3 columns ( name | lastname | age ) in that order. What I need is to change the position of the columns when clicking a button to ( age | lastname | name). Is there any way of doing this ? I did it by creating 2 grids and change them each other when the button is clicked but I was wondering if there is any way of doing the same thing with only one grid.
Here is a link how to dynamically set column order using a button. The example should help you in your quest to fill your needs.
I have 10 comboboxes with players. In each combobox must be selected one player. Now, I must validate their so, that only one unique player can be selected in combobox.
For example:
combobox1 - Anna
combobox2 - Anna (too)
But if Anna is selected I don't want choose she in another combobox. Or I can show error message on click button "Start Game", that Anna is selected in two comboboxes. The main thing it must be validate. I have only one Idea how I ca validate this and it's not the best way.
if cmbPlayer1.SelectedValue = cmbPlayer2.SelectedValue Or
cmbPlayer1.SelectedValue = cmbPlayer2.SelectedValue Or
...
cmbPlayer1.SelectedValue = cmbPlayer10.SelectedValue
and so for each of ten combobox.
How I can do it better?
Create List of all selected value of value.
List<Player> players=new List<Player>
palyers.add(cmbPlayer1.SelectedValue)
upto 10 Players.
Then check unique values
palyers.Distinct().Count()==10
How bout this
I tried with one combobox with bunch of names inside,and one listbox to show 10 players that have selected on the combobox. i make a condition like this :
If you select the same name it will shows an message "Multiple name detected". Else if you didn't do that you'll able to add another name to listbox.
So i make the "prevention" condition when selecting names,not when the button pressed.
Try to add a listbox and combobox,fill the listbox value with names. And make the name appear on listbox when you select it.
And code like this on the combobox
Private Sub ComboBox1_SelectedIndexChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles ComboBox1.SelectedIndexChanged
If Not ListBox1.Items.Contains(ComboBox1.Text) Then
ListBox1.Items.Add(ComboBox1.Text)
Else
MsgBox("Multiple name detected")
End If
End Sub
Hope this will help you,and sorry for my bad english.
in our application, we can have only 6 controls per row. 6 controls can be either text box or drop down or label what ever it might be. i am having city, state,zip and country fields where city and zip are text boxes. remaining two are drop downs. when country USA is selected, i need city,state and zip to be required fields. when other than USA, state drop down needs to convert in to textbox and 3 textboxes should convert to optional fields. it should not fire error messages. i tried to hide and show textboxes based on country value. but we can have only 6 controls per row. as country is already there, we can have max of 5 controls but if i am replacing, then i need 6 controls. i am trying to do this only in angular js. it would be great if any one can help me?