UWP grouping items in ComboBox - xaml

I search to group items in a ComboBox control like this:
group
item 1
item 2
group 2
item3
...
So, I tried this example: here which is for WPF but does not work for UWP because ListCollectionView does not exist. So I tried with CollectionViewSource without any success.
Thanks
Samuel

Related

SSRS Lookup on single dataset

Hopefully you can help!
I have a single data source in my SSRS report. With this data source, I have populated a tablix. The tablix looks something like this:
SalesPerson ID Group Sales
Sarah 1 1 1234
Ross 2 1 555
Gemma 3 2 678
Jill 4 2 345
Jack 5 3 987
Peter 6 2 432
Henry 7 2 356
The report is set up to create a different page for each of the sales people. for example, on the first page of the report, only first record would be shown (the record that holds Sarah's information, the second page would show the record for Ross' information ,etc..)
The issues I face is this:
At the bottom of the report, I need to include a textbox that displays the group number that the specific employee belongs to (the employee who is currently being displayed on the page).
I think that I need to do some sort of lookup on the IDReportItem to return the group ID in order to do this, but have had no luck in my attempts.
I understand that this is a horrible way of doing things, but I am limited to using this single dataset for performing this task.
Any help you can provide will be greatly appreciated,
Thanks you!
Unfortunately there doesn't seem to be a way to do this in a single textbox, but you can do it with a second tablix that uses the same dataset.
Create your second tablix and position it at the bottom of the page, then set your grouping to be the same on both tablixes and use the second tablix to only display the group ID, plus whatever label you want.
Create a new row group for each tablix (grouping on group ID), then right click the group and browse to Group Properties -> Page Breaks and check the box that says "Between each instance of a group". Do this for both tablixes.
This is what grouping is designed for. Build your table, and set the page break attribute to true.
You can have multiple rows under your group. Since your group is a field, simply add it to the detail row.
Your grouping is obviously set up right to get the report paging correctly.
You could add a List to the report, set the grouping on that (with page break between groups)
Inside the list - Add a RECTANGLE. (this be important!)
Once you've added the rectangle, you can add another as many objects as you like. In your case I think that may be a matrix and a text box
eg
Then it just becomes as spacing issue (to get the page looking right)

Adding menustripitems on top of existing ones

In my simple WinForm application I have a ContextMenuStrip. This is palced during design time and few items have been added in designer mode. For example following items are added during design time,
--------
Option 1
Option 2
Option 3
--------
Close
Exit
Now I am getting the Groups from database. Each Group can have multiple users. So first I create the Groups using this code,
For Each drGroup In dtGroups.Rows
Dim groupMenu As New ToolStripMenuItem() With {.Text = drGroup ("GroupName"),
.Name = RemoveWhitespace(drGroup ("GroupName"))
}
myCMS.Items.Add(groupMenu)
Next
I am not mentioning the code for adding sub items for groups as it is beyond the context of this question. Now my context menu strip is like this,
--------
Option 1
Option 2
Option 3
--------
Close
Exit
Group 1
Group 2
Group 3
Group 4
Group 5
But I want the output like this,
Group 1
Group 2
Group 3
Group 4
Group 5
--------
Option 1
Option 2
Option 3
--------
Close
Exit
I have no idea how I can achieve this. One way could be to remove the existing items and re-add them after all dynamic items are created but is there any other solution.
Instead of adding items, you can simply insert them into the beginning of the list:
myCMS.Items.Insert(0, groupMenu)
This will change the "index" values of the existing items in the current list.

Display only two fields from Access table

New to Access here... I asked a similar question the other day, but have a new twist for a different form I am creating.
Say I have a table (tblNamesAndValues) that looks like this:
Name Value
---- ----
Mary 100
Carrie 500
Terri 999
Gerrie 749
I have created a form that displays all four names and values.
My question is this: how can you make the form display only the names Mary and Terri and their values, and have the values in updateable textboxes? On top of that, is there any way to only display those two, and not the blanks underneath that allow new entries?
Thanks in advance...
You can filter the form or use a query instead of the table as table source:
select * from tblNamesAndValues where name = "Mary" or name = "Terry"
For disabling the blank line, just set the AllowAdditions property of the form to false.

Choosing and keeping multiple radio button value inside a table

I am using radio button for choosing employee type such as part-time , full-time etc.I could choose only one item according followed table structure.How can i select multiple radio button and keep these inside a table.For instance such as keeping inside an array?
+--------------+----------------+
| EmployeeId | EmployeeType |
+--------------+----------------+
| 2 | 2 |
+--------------+----------------+
| 3 | 1 |
+--------------+----------------+
EmployeeTypes :
0 Part-time
1 Full-time
2 Consultant
3 Trainer
In HTML, radio buttons work by posting different values to the same name - the value of the item selected.
<form action="">
<input type="radio" name="sex" value="male">Male
<input type="radio" name="sex" value="female">Female
</form>
http://www.w3schools.com/html/tryit.asp?filename=tryhtml_radio
However, if you have a table of data, and you need to be able to edit multiple rows at the same time, there will be the need to differentiate between EmployeeType for User 2 and EmployeeType for User 3. So the radio buttons with various values might now instead post to names such as EmployeeType_2 and EmployeeType_3.
This is essentially what will happen behind the scenes when you try to do code like the following.
How can I post a list of items in MVC
At some point here you may want to actually consider using a grid control, but I'm not trying to plug Telerik or DevExpress controls. So, instead I'll mention the following that came up in my search. Perhaps other users can suggest other controls.
http://www.codeproject.com/Tips/720348/MVC-Grid-Inline-Edit
http://www.codeproject.com/Articles/165410/ASP-NET-MVC-Editable-DataTable-jQuery-DataTables-a

GridView Blank On Pagination

I have no problem getting a GridView or ListView to page, normally. If I use Sql datasource and I use a query like:
SELECT RecipeName FROM PostedRecipes
and I enter Hot Dog, for example, in a search text box, and there are 40 Hot Dog recipes, the GridView/ListView will show page 1 with 10 recipes (if the count is set to 10) and show that there are 3 more pages to go. Each page then, page 2 or 3 or 4, will show additional recipes. However,
If I use a query like:
SELECT RecipeName FROM PostedRecipes
WHERE RecipeName LIKE '%' + #RecipeName + '%' GROUP BY RecipeName
and I make the same search entry, the GridView will show page 1 with 10 recipes and indicate that there are 3 more pages. BUT, if I click on page 2 or 3 or 4, a blank page is then displayed.
If I set the count to 40, all 40 recipes will be displayed on the initial search - which would indicate that all the recipes are being retrieved from the database. I am not sure if this is some sort of GridView problem or a postback problem of some sort. Any help would be appreciated.