Telerik Forums RSShttps://www.telerik.com/urn:uuid:6edbe7ea-201a-44a2-b8d3-2af024ed0365https://www.telerik.com/forums/permalink/6ufbbhogokS40yrwJO0DZQInserting a Column from second data sourceHello Shaun,<br />
<span style="line-height: 1.4;"><br />
Thank you for writing back.<br />
</span><span style="line-height: 1.4;"><br />
Аdding the new column to the data source and passing this data source to the PivotGrid DataProvider must update the PivotGrid because the grid will pivotize a new column for the calculations.<br />
</span><span style="line-height: 1.4;"><br />
I am not sure that I fully understand your intention. You can set the size to the particular column using the following code:</span>
<div class="tFormatCodeBlock supportThreadCodeBlock" style="border: 1px solid #7f9db9; overflow-y: auto;" id="highlighter_60937">
<div style="background-color: #ffffff;"><span style="margin-left: 0px !important;"><code style="color: #000000;">radPivotGrid1.PivotGridElement.UpdateCompleted += </code><code style="color: #006699; font-weight: bold;">new </code><code style="color: #000000;">EventHandler(PivotGridElement_UpdateCompleted);</code></span></div>
<div style="background-color: #f8f8f8;"><span><code>&nbsp;</code><span style="margin-left: 3px !important;">&nbsp;</span></span></div>
<div style="background-color: #ffffff;"><span><code>&nbsp;</code><span style="margin-left: 3px !important;"><code style="color: #006699; font-weight: bold;">void </code><code style="color: #000000;">PivotGridElement_UpdateCompleted(</code><code style="color: #006699; font-weight: bold;">object </code><code style="color: #000000;">sender, EventArgs e)</code></span></span></div>
<div style="background-color: #f8f8f8;"><span><code>&nbsp;</code><span style="margin-left: 3px !important;"><code style="color: #000000;">{</code></span></span></div>
<div style="background-color: #ffffff;"><span><code>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</code><span style="margin-left: 36px !important;"><code style="color: #006699; font-weight: bold;">foreach </code><code style="color: #000000;">(PivotGroupNode node </code><code style="color: #006699; font-weight: bold;">in </code><code style="color: #006699; font-weight: bold;">this</code><code style="color: #000000;">.radPivotGrid1.PivotGridElement.GetColumnGroups())</code></span></span></div>
<div style="background-color: #f8f8f8;"><span><code>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;</code><span style="margin-left: 36px !important;"><code style="color: #000000;">{</code></span></span></div>
<div style="background-color: #ffffff;"><span><code>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</code><span style="margin-left: 48px !important;"><code style="color: #006699; font-weight: bold;">if </code><code style="color: #000000;">(node.Name == </code><code style="color: blue;">"Sum of Freight"</code><code style="color: #000000;">)</code></span></span></div>
<div style="background-color: #f8f8f8;"><span><code>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</code><span style="margin-left: 48px !important;"><code style="color: #000000;">{</code></span></span></div>
<div style="background-color: #ffffff;"><span><code>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</code><span style="margin-left: 60px !important;"><code style="color: #000000;">node.PreferredSize = 300;</code></span></span></div>
<div style="background-color: #f8f8f8;"><span><code>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</code><span style="margin-left: 48px !important;"><code style="color: #000000;">}</code></span></span></div>
<div style="background-color: #ffffff;"><span><code>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</code><span style="margin-left: 36px !important;"><code style="color: #000000;">}</code></span></span></div>
<div style="background-color: #f8f8f8;"><span><code>&nbsp;&nbsp;</code><span style="margin-left: 6px !important;"><code style="color: #000000;">}</code></span></span></div>
</div>
<br />
Please, bear in mind that this code&nbsp;should be performed when the UI is already built.<br />
<br />
I hope this helps.
<br />
<br />
Greetings,<br />
Peter <br />
the Telerik team
<div class="forumBaloonTop"></div>
<div class="forumBaloon">WinForms Q1 2013 boasts PivotGrid, PDF Viewer, Chart enhancements and more.
<a href="http://www.telerik.com/products/winforms/whats-new.aspx" target="_blank"><span style="color: #005fb9;">Check out all of the latest highlights.</span>
</a></div>
<div class="forumBaloonBottom"></div>urn:uuid:4f1c60ff-2cc1-4d15-94a4-475e9268df9bhttps://www.telerik.com/forums/permalink/_2AcT8EsFU2UpEdekmjfmwInserting a Column from second data source<p><span style="color: #333333; font-family: Arial,sans-serif; font-size: 10.5pt;">Hi Peter,<br>
<br>
Thanks for getting back to me, the new feature will make this control very usable, great work.<br>
As a work around I have tried modifying the datasource but with no success.<br>
<br>
Another option would be to tack on / position a grid at the end column of the pivot grid.<br>
The problem I have is finding the position of the last column, so far I can set the position of the new grid to the end of the pivot component, but there could be a large gap from the last column to the end of the pivot component. Aligning rows is also a challenge.<br>
<br>
Any suggestions would be great.<br>
<br>
Cheers<br>
<br>
Shaun.</span></p>
<br>
<br>urn:uuid:b8370c8e-9417-41c3-8601-2ccecff54bbahttps://www.telerik.com/forums/permalink/jgw3uBeUw0GGASzOz_VLugInserting a Column from second data sourceHi Shaun,<br />
<span style="line-height: 1.4;"><br />
Thank you for writing.<br />
</span><span style="line-height: 1.4;"><br />
This functionality is not supported and a feature request for such already exists. Feel free to add your vote for it here:&nbsp;</span><a href="http://www.telerik.com/support/pits.aspx#/details/Issue=12876" target="_blank" style="line-height: 1.4;">http://www.telerik.com/support/pits.aspx#/details/Issue=12876</a><span style="line-height: 1.4;"> - this item concerns adding an unbound data column to the Pivot calculations.<br />
</span><span style="line-height: 1.4;"><br />
For the time being, I am not able to provide you with a specific time frame for this feature request.<br />
</span><span style="line-height: 1.4;"><br />
As a workaround you should try to incorporate this column to the data source and pass this data source to the PivotGrid DataProvider.<br />
</span><span style="line-height: 1.4;"><br />
I hope this helps.<br />
</span><span style="line-height: 1.4;"><br />
</span>
Greetings,<br />
Peter <br />
the Telerik team
<div class="forumBaloonTop"></div>
<div class="forumBaloon">WinForms Q1 2013 boasts PivotGrid, PDF Viewer, Chart enhancements and more.
<a href="http://www.telerik.com/products/winforms/whats-new.aspx" target="_blank"><span style="color: #005fb9;">Check out all of the latest highlights.</span>
</a></div>
<div class="forumBaloonBottom"></div>urn:uuid:9aa94f0b-290a-4282-bd80-a3b1d9a70ac3https://www.telerik.com/forums/permalink/C0-pmgopgkK9gKOx2acKwwInserting a Column from second data sourceHi,<br>
<br>
<span style="color: #333333; font-family: 'Arial','sans-serif'; font-size: 10.5pt; mso-fareast-font-family: Calibri; mso-fareast-theme-font: minor-latin; mso-ansi-language: EN-NZ; mso-fareast-language: EN-US; mso-bidi-language: AR-SA;">Is it possible to insert a column that's not part of the main datasource of a pivot grid, kinda difficult to explain but what I want to do is:<br>
<br>
1. Show a pivot grid with aggregate columns over a time period.<br>
2. Insert a start position from another datasource.<br>
<br>
If you look at the attached image, it might give a better clue as to what I want to do:<br>
<br>
The Column in Red, Start Inventory, is the column I want to insert, this data comes from a second dataset, the key being stock item.<br>
<br>
The Totals Column is just the sum of Purchases / Sales / Loss.<br>
<br>
What would be cool would be to add a second column that would calculate the Start Inventory - Totals (not shown on image)<br>
<br>
Hope this makes sense,<br>
<br>
Cheers<br>
<br>
Shaun.</span><br>
<br>
Cheers<br>
<br>
Shaun.