Infragistics Silverlight XamGrid with different layouts in hierarchy - silverlight

How can I create a XamGrid with a ColumnLayout that looks like,
| Name |
John
(+/-)
| First Name | Last Name | Address |
Mary
(+/-)
| Height | Weight |

From the description it appears that you would like to have a hierarchical grid where you would expand out different details for different rows. The XamGrid does allow sibling ColumnLayouts in a nested layout and there is an example of this in the help topic for Defining Hierarchical Layouts:
http://help.infragistics.com/NetAdvantage/Silverlight/Current/CLR4.0?page=xamGrid_Defining_Hierarchical_Layouts.html

Related

Combining fields in Google Data Studio

I have a CSV file of the form (unimportant columns hidden)
player,game1,game2,game3,game4,game5,game6,game7,game8
Example data:
Alice,0,-10,-30,-60,-30,-50,-10,30
Bob,10,20,30,40,50,60,70,80
Charlie,20,0,20,0,20,0,20,0
Derek,1,2,3,4,5,6,7,8
Emily,-40,-30,-20,-10,10,20,30,40
Francine,1,4,9,16,25,36,49,64
Gina,0,0,0,0,0,0,0,0
Hank,-50,50,-50,50,-50,50,-50,50
Irene,-20,-20,-20,50,50,-20,-20,-20
I am looking for a way to make a Data Studio view where I can see a chart of all the results of a certain player. How would I make a custom field that combines the data from game1 to game8 so I can make a chart of it?
| Name | Scores |
|----------|---------------------------------|
| Alice | [0,-10,-30,-60,-30,-50,-10,30] |
| Bob | [10,20,30,40,50,60,70,80] |
| Charlie | [20,0,20,0,20,0,20,0] |
| Derek | [1,2,3,4,5,6,7,8] |
| Emily | [-40,-30,-20,-10,10,20,30,40] |
| Francine | [1,4,9,16,25,36,49,64] |
| Gina | [0,0,0,0,0,0,0,0] |
| Hank | [-50,50,-50,50,-50,50,-50,50] |
| Irene | [-20,-20,-20,50,50,-20,-20,-20] |
The goal of the resulting chart would be something like this, where game1 is the first point and so on.
If this is not possible, how would I best represent the data so what I am looking for can work in Data Studio? I currently have it implemented in a Google Sheet, but the issue is there's no way to make views, so when someone selects a row it changes for everyone viewing it.
If you have two file games as data sources, I guess that you want to combine them by the name, right?
You can do it with the blending data option. Resource > manage blends I think is the option.
Then you can create a blend data source merging it by the name.
You can add also both score fields, with different labels.
This is some documentation about it: https://support.google.com/datastudio/answer/9061420?hl=en

Grid with grouped headers/columns (super headers)

I would like to achieve something like:
Day 1 | Day 2
--------------------------------------| -------------------------------------
Location 1 | Location 2 | Location 3 | Location 1 | Location 2 | Location 3
---------- | ---------- | ----------- | ---------- | ---------- | -----------
| | | | |
-----------------------------------------------------------------------------
| | | | |
-----------------------------------------------------------------------------
| | | | |
-----------------------------------------------------------------------------
| | | | |
-----------------------------------------------------------------------------
I need to display a list of appointments/events for specific days but grouped by locations.
I want to display days and locations even when there are no events (just empty grid so I can add my own events there).
I'm planning on using DataGrid or ListBox/ListView. Is it a good idea or I should create those headers some other way? Could you point me in the right direction?
This question is just about displaying empty grid(multiple listviews or datagrid with headers generated from list of locations and list of dates):
public IObservableCollection<DateTime> DaysToDisplay { get; set; }
public IObservableCollection<string> LocationsToDisplay { get; set; }
I'm a bit confused by your edit saying:
"This question is just about displaying empty grid (generated from list of locations and list of dates)"
Because that directly contradicts:
"I need to display a list of appointments/events for specific days"
But you keep on editing your question and one of those can't be true.
WPF datagrid is best for editing, if that's what you mean by "add my own events there". Although editing directly in a datagrid introduces a lot of edge cases if you are going to validate.
The datagrid doesn't support grouped headers like that.
All solutions you could adopt come with some limitations.
One would be to make the Days template columns. You then line up your 3 locations inside them in the one template.
One way of building these repeated columns dynamically:
https://gallery.technet.microsoft.com/WPF-Dynamic-XAML-Awkward-41b0689f
Another option is 2 datagrids.
The top one only has headers - these being the Days.
The main datagrid is below that and in the same grid, the locations are columns in that.
This works best if the user can't do things like resize and re-order columns.
Re-sizing can be handled by binding the width of the day columns using a converter adds up the width of the corresponding day columns.
An example:
https://social.msdn.microsoft.com/Forums/vstudio/en-US/1e414159-70f6-4be3-9be5-56e4f3278366/wpf-multicolumn-super-header?forum=wpf

Friendship Website Database Design

I'm trying to create a database for a frienship website I'm building. I want to store multiple attributes about the user such as gender, education, pets etc.
Solution #1 - User table:
id | age | birth day | City | Gender | Education | fav Pet | fav hobbie. . .
--------------------------------------------------------------------------
0 | 38 | 1985 | New York | Female | University | Dog | Ping Pong
The problem I'm having is the list of attributes goes on and on and right now my user table has 20 something columns.
I feel I could normalize this by creating another table for each attribute see below. However this would create many joins and I'm still left with a lot of columns in the user table.
Solution #2 - User table:
id | age | birth day | City | Gender | Education | fav Pet | fav hobbies
--------------------------------------------------------------------------
0 | 38 | 1985 | New York | 0 | 0 | 0 | 0
Pets table:
id | Pet Type
---------------
0 | Dog
Anyone have any ideas how to approach this problem it feels like both answers are wrong. What is the proper table design for this database?
There is more to this than meets the eye: First of all - if you have tons of attributes, many of which will likely be null for any specific row, and with a very dynamic selection of attributes (i.e. new attributes will appear quite frequently during the code's lifecycle), you might want to ask yourself, whether a RDBMS is the best way to materialize this ... essentially non-schema. Maybe a document store would be a better fit?
If you do want to stay in the RDBMS world, the canonical answer is to have either one or one-per-datatype property table plus a table of properties:
Users.id | .name | .birthdate | .Gender | .someotherfixedattribute
----------------------------------------------------------
1743 | Me. | 01/01/1970 | M | indeed
Propertytpes.id | .name
------------------------
234 | pet
235 | hobby
Poperties.uid | .pid | .content
-----------------------------
1743 | 234 | Husky dog
You have a comment and an answer that recommend (or at least suggest) and Entity-Attribute-Value (EAV) model.
There is nothing wrong with using EAV if your attributes need to be dynamic, and your system needs to allow adding new attributes post-deployment.
That said, if your columns and relationships are all known up front, and they don't need to be dynamic, you are much better off creating an explicit model. It will (generally) perform better and will be much easier to maintain.
Instead of a wide table with a field per attribute, or many attribute tables, you could make a skinny table with many rows, something like:
Attributes (id,user_id,attribute_type,attribute_value)
Ultimately the best solution depends greatly on how the data will be used. People can only have one DOB, but maybe you want to allow for multiple addresses (billing/mailing/etc.), so addresses might deserve a separate table.

RDLC Report - Repeating vertical lines on all pages

I am designing an Invoice (Bill) using RDLC, WinForms, C# in Visual Studio 2012. The Invoice could span from 1 to N pages. I am using Tablix to show the Invoice details (line items) in the Report Body. An Invoice may contain 1 to N line items.
As per the design requirement the Tablix Columns need to be separated by Visible Vertical Lines when the report is viewed, printed or exported. These lines need to start at the top near the Tablix Header and run to the end of the page i.e. they cover the Report Body from top to bottom. The Body part of the Invoice looks something like this:
| SNo.| Code | Quantity | Particulars | Rate | Amount |
| | | | | | |
| | | | | | |
| | | | | | |
| | | | | | |
| | | | | | |
| | | | | | |
I thought of 2 options to do this:
Turn ON the border of the Tablix on all 4 sides.
This does not work because if the records are less, then the lines are only shown half way through the page.
Turn OFF the border of the Tablix on all 4 sides and use the LINE OBJECTs to decorate the Invoice and extend it till the end of the page. This works only on the first page and no Lines are shown on the subsequent pages.
There were other options that I thought of, but did not give me a clean result and was a compromise in other areas.
Please help me as I am completely stuck.
In a VS2005 application (no Tablix) I had to:
set body height so that the sum of header height + body height + footer height + top/bottom margin = PageSize.Height
put one rectangle for every column OVER my table (i.e. 1 rectangle for SNo. column, 1 rectangle for Code column)
set RepeatWith of every rectangle to my table
I think the same solution will work for VS2012, Tablix and Line: try to set Line.RepeatWith to your Tablix.
You can use list for displaying data with a table inside it.
Then have a list height full upto bottom. Draw vertical lines inside list upto bottom.
Then in list group, provide following expression.
ROWNUMBER(nothing)\20.
20 is the number of lines required on one page.

Extjs how to represent matrix in extjs

Is there any Extjs component to represent an editable matrix.
Something along these lines:
+------------------------------------+
| name | bid1 | bid2 | bid3 |
+------------------------------------+
| supplier A | |
| supplier B | |
| supplier c | |
+------------------------------------+
Like an editable grid? Have you looked at all of the grid samples?
You are looking for a pivot table. Options:
https://market.sencha.com/extensions/mzpivotgrid
or for extjs 3.4† :
http://docs.sencha.com/extjs/3.4.0/#!/api/Ext.grid.PivotGrid
† (you can use 3 and 4 at the same time with the compatibility layer) http://www.sencha.com/blog/ext-js-3-to-4-migration/
Refer here. You can edit any entry in grid using editable grid panel.

Resources