Hello
I'm trying to layout a datagrid to display option values. Each column is a specific contract month, and each row is a strike. There are two different values (cv and pv) and other variables (left off this example) for each strike. It should look kind of like this:
JUN SEP DEC
cv 100 pv cv 100 pv cv 100 pv
cv 200 pv cv 200 pv cv 200 pv
cv 300 pv cv 300 pv cv 300 pv
I created (or tried to create) an observable collection of observable collections. My grid has 15 columns, so it creates 15 "expirMo"s each of which is an observable collection of "values" which contains the strike, cv, and pv. Each month has the same 500 strikes with different cv and pv values.
My problem is that I cannot get the data to layout correctly. I get 15 columns, that when I expand them shows the strike,cv,pv (500 times) in a horizontal table. I can only expand one at a time.
If you can point me to or create an example of how create the layout described above, it would be very helpful. I'm not sure that my logic of creating a collection of collections is correct, I'm open for anything that will allow me to display the data in a manner similar to above.
Thanks
Hello,
I am just checking the progress of this issue and was wondering if you managed to achieve your goal or if you need any further assistance on the matter.
It seems like that you have send me wrong sample, because the .xaml and .cs files are empty. Could you please double check if you send me a different sample or I am missing something about it.
Looking forward for your reply.
Ekaterina
Thanks for your sample, it was helpful but leads me to two more questions. I have attached my sample code for your reference.
First: I switched the orientation to horizontal, but this isn't really want I want. I the list of months to display horizontally, but the internal list to display vertically--similar to my typed out example in my first post. How can I set this?
Second: I am stuck setting up custom field layouts. In the XAML of my sample code you will see my attempt to create a style to read the "call" and "put" classes I created which hold the various parts of data. How can I make this work correctly? Further: I need each "strike" cell to be displayed as follows--but can't figure out where is the correct place/way to put this in the XAML.
Field should have a colspan of 10, and a rowspan of 3.
the call.value variable should be cols 1-3 and rows 1-2
the call.delta variable should be cols 1-2 and row 3
the call.numstrd variable should be col 3 row 3
the strikeNum variable should be cols 4-7 and all three rows
the put.value variable should be cols 8-10 and rows 1-2
the put.delta variable should be cols 8-9 row 3
the put.numstrd variable should be col 10 row 3
This layout is repeated for each strike in the strike list(vertically), and is then repeated for each month(horizontal. I'm trying to keep these as individual variables instead of strings because I'm later going to need to click on them seperately to do calculations.
Thanks for the help!
I have been looking into your issue and in order to have your goal achieved you can create an observable collection of objects that have property which returns an observable collection. If you have a class called “A” and it has properties “b” and “c”, the first one can be a collection and the other can be for example a string. What will happen if you let the grid to auto generate its layout is that the “b ” collection will be rendered in a new layout and the “c” property will be displayed in its parent row, that you can expand via the “+” expansion indicator on your left.
I have created a small sample project in order to demonstrate the described approach.
Please let me know if my sample meets your requirements or I have misunderstood you at some point.
Sincerely,
Developer Support Engineer
Infragistics, Inc.
www.infragistics.com/support