Telerik Forums
UI for WinForms Forum
0 answers
3 views

I have data from a table (child) that may or may not contain values from another table (parent).  When I use the data in the pivot grid, I only see the party field values that exist in my child table, I want to be able to see all the values from the parent table

Example

                  Status      ACTIVE          INACTIVE         DISABLED       CANCELED

Positions

FIRST BASE                    1                           0                           0                    0
SECOND BASE               2                           1                            0                    0
SHORT STOP                 0                           0                           0                    0
THIRD BASE                  10                          10                         13                    12

 

Is this at all possible, by just feeding the data to the DataSource of the pivot grid?

 

Thanks

Mark
Top achievements
Rank 2
Bronze
Iron
Veteran
 asked on 17 May 2024
0 answers
2 views

Is there the ability to set the default STEP for a field that has not been used as an aggregate but is in the list for the user to select? We have an AGE field, and when the user drags it to either the ROW or COLUMN, the default STEP is 100. We need it to default to 10. Can we do this programmatically?

 

TIA.

Mark
Top achievements
Rank 2
Bronze
Iron
Veteran
 asked on 17 May 2024
1 answer
22 views

I am having issues where data getting exported to an XLSX file where some tabs are not getting the data. FileExportMode is set to FileExportMode.NewSheetInExistingFile and the file is not in use.  The weird part, is I can run the code multiple times and each time, it is different tabs that don't get populated. In the end, I  should end up with 14 tabs and I get those 14 tabs, the only thing that is in the tabs, is the headers.  if I export that data for each tabs individual to their own file, the data is there and exported as expected.  Maybe I am missing something?

Another weird part, is when I watch the file exporting (in window explorer), you can see the file go to 0KB. It is really weird

Here is my export code


         List<Tuple<int, string, bool>> jurisdictionTypes =
            new JurisdictionTypeDA().GetJurisdictionTypeKeyValueList();

         foreach (Tuple<int, string, bool> jurisdictionType in jurisdictionTypes)
         {
            RadPivotGrid tempPivotExportGrid = new RadPivotGrid
            {
               ColumnGrandTotalsPosition = TotalsPos.None,
               ColumnsSubTotalsPosition = TotalsPos.None,
               EmptyValueString = "0",
               RowGrandTotalsPosition = TotalsPos.None,
               RowsSubTotalsPosition = TotalsPos.None
            };

            var exportResults = _apportionmentInfoPivot
               .Where(app => app.JurisdictionTypeKey == jurisdictionType.Item1
               .OrderBy(app => app.PartySort)
               .ThenBy(app => app.LegacyKeyValue)
               .Select(app => new
               {
                  jurisdiction_name = app.JurisdictionName?.Trim() ?? string.Empty,
                  party_name = app.PartyName?.Trim() ?? string.Empty,
                  totalvoters = app.TotalVoters,
                  signaturesneeded = app.SignaturesNeeded
               })
               .ToList();

            tempPivotExportGrid.DataSource = exportResults;
            tempPivotExportGrid.RowGroupDescriptions.Clear();
            tempPivotExportGrid.ColumnGroupDescriptions.Clear();
            tempPivotExportGrid.AggregateDescriptions.Clear();

            // Row Information
            PropertyGroupDescription myRows = new PropertyGroupDescription
            {
               PropertyName = "jurisdiction_name",
               CustomName = "Jurisdiction",
               SortOrder = Telerik.Pivot.Core.SortOrder.None
            };

            tempPivotExportGrid.RowGroupDescriptions.Add(myRows);

            // Column Information
            PropertyGroupDescription myCols = new PropertyGroupDescription
            {
               PropertyName = "party_name",
               CustomName = "Party",
               SortOrder = Telerik.Pivot.Core.SortOrder.None
            };
            tempPivotExportGrid.ColumnGroupDescriptions.Add(myCols);

            // Aggregate Information
            tempPivotExportGrid.AggregateDescriptions.Add(new PropertyAggregateDescription()
            {
               PropertyName = "totalvoters",
               CustomName = "Count",
               AggregateFunction = AggregateFunctions.Sum,
               StringFormat = "#,##0"
            });

            tempPivotExportGrid.AggregateDescriptions.Add(new PropertyAggregateDescription()
            {
               PropertyName = "signaturesneeded",
               CustomName = "Needed",
               AggregateFunction = AggregateFunctions.Sum,
               StringFormat = "#,##0"
            });

            tempPivotExportGrid.AggregatesPosition = PivotAxis.Columns;

            // Combine each result into a new tab
            PivotGridSpreadExport spreadExport = new PivotGridSpreadExport(tempPivotExportGrid)
            {
               SheetName = jurisdictionType.Item2,
               FileExportMode = FileExportMode.NewSheetInExistingFile
            };
            spreadExport.RunExport(myExportFile, new SpreadExportRenderer());

            // Send each result to their own sheet
            PivotGridSpreadExport mySpreadExport2 = new PivotGridSpreadExport(tempPivotExportGrid)
            {
               SheetName = jurisdictionType.Item2,
               FileExportMode = FileExportMode.CreateOrOverrideFile
            };
            string newfile = string.Concat(Path.Combine(Path.GetDirectoryName(myExportFile) ?? string.Empty, Path.GetFileNameWithoutExtension(myExportFile)), "_", jurisdictionType.Item2, Path.GetExtension(myExportFile));
            mySpreadExport2.RunExport(newfile, new SpreadExportRenderer());


         }

Due to the nature of the data, I can't share the results, so I will try to re-create this in a temp project.

 

I have attached a like to a video, you can see at 4 seconds and 9 seconds, the file is emptied (0 KB).

https://app.screencast.com/6SjZNCAoooWUh

TIA for any help here.

 

Dinko | Tech Support Engineer
Telerik team
 answered on 27 Feb 2024
3 answers
31 views

Probably more of a suggestion than a question.

I would like an FileExportMode that is between the 2 existing modes. It creates or overrides the named Sheet in the given XLSX

User could then:

  • Export to a named sheet.
  • Add another sheet that references the exorted data
  • Run the Export again to refresh the data
Nadya | Tech Support Engineer
Telerik team
 answered on 10 Nov 2023
2 answers
73 views

I would like to know how to access the values that are typed in all the "Value Filter" and "Label Filter" options, which appear in the PivotGrid filters in the RowGroupDescriptions and ColumnGroupDescriptions parts, since I require those values to perform additional calculations.

I have tried to reach the values but I only reach the Type of condition and the value, I provide the code that I use for what I mention:

foreach (PropertyGroupDescriptionBase gd in this.radPivotGrid1.RowGroupDescriptions)
{
ValueGroupFilter Filtroporvalor = gd.GroupFilter as ValueGroupFilter;                    

if (Filtroporvalor.Condition != null)
{
ComparisonCondition condition = Filtroporvalor.Condition as ComparisonCondition;

var condicionaux = condition.Condition;
var valorthan = condition.Than;

switch (condicionaux.ToString())
{
case "Equals":
//Code that performs additional calculations
break;
case "IsGreaterThan":
//Code that performs additional calculations
break;
case "IsDoesNotEqual":
//Code that performs additional calculations
break;
}
}
}

But I cannot reach the other values, for example if I use "Equals", I would also like to obtain the name of the field that is used to perform that condition and so on for the other options of "Value Filter", that field is the one that is you can select in the window that is displayed when the filter is applied:


Thank you for your support.

Dinko | Tech Support Engineer
Telerik team
 answered on 22 Sep 2023
1 answer
31 views

I know how to sort column chooser for RadGridview:

e.ColumnChooser.SortOrder = RadSortOrder.Ascending

is there a way to sort Field Chooser for RadPivotGrid too?

Dinko | Tech Support Engineer
Telerik team
 answered on 01 Aug 2023
1 answer
61 views

Hi, good morning.

I am using a Pivotgrid, PivotFieldList and Chartview.

The chartview graphs whatever the Pivotgrid has, but there are times when the Pivotgrid has too many records and the Chartview takes a long time to generate.

As seen in the documentation, a Chartview takes time, because it is recalculating the points to regenerate the graph, after having created it previously.

This has led me to think that if instead of the Chartview graphing the Pivotgrid, it would better graph a DataTable.

My idea is the following:
I already generated a filtered DataTable, the result of the interaction between the Pivotgrid and the PivotFieldList and that DataTable fills the Chartview to generate the graph, I think it would take less time to create the graph, since each time the filtered DataTable would be created.

I was looking at this example that you provide to create a graph from a datatable:
https://www.telerik.com/forums/use-radgridview-as-a-datasource-for-radchartview

But it does not graph as expected, that is, it does not show the graphs the same as when the pivotgrid is filled.

Is it possible to do this, or even if you do, will the graph creation time be the same? Because if so, there is no point in working on this solution.

 

Thank you very much for your attention.

Dinko | Tech Support Engineer
Telerik team
 answered on 20 Jun 2023
1 answer
46 views

Hello good afternoon.

I ask for your support, for the following.

In a graph, when there are many elements in X, the labels come together a lot and the text is not understood.

 

When I apply a configuration by code, the graph does look better:

            horizontalAxis.MajorTickInterval = 10;
            horizontalAxis.TickLength = 10;
            horizontalAxis.TickWidth = 10;

 

I would like to start from the number of elements on the X axis that the labels begin to join, to automatically apply the aforementioned code.

My fear is that at some point, it doesn't graph well and it jumps strangely when graphing, could this happen?

Thank you so much
Dinko | Tech Support Engineer
Telerik team
 answered on 19 Jun 2023
1 answer
50 views

Hi,

I have a pivotgrid table like this:

true  |  vegetables    |   data   |  data  |  data
         |  fruit                |   data   |  data  |  data
         |  subtotal         |   data   |  data  |  data
----------------------------------------------------
false  | vegetables    |   data   |  data  |  data
          | fruit                |   data   |  data  |  data
          | subtotal         |   data   |  data  |  data 
How can i change the row header (true, false that are boolean values) using specifically cellformating?

Dinko | Tech Support Engineer
Telerik team
 answered on 20 Apr 2023
1 answer
47 views

Hello,

I am trying to export a radPivotGrid into excel as per the documentation

 

 private void radButton1_Click(object sender, EventArgs e)
        {
            SaveFileDialog sf = new SaveFileDialog();
            sf.Filter = "EXCEL | .xls";
            if (sf.ShowDialog() == System.Windows.Forms.DialogResult.OK)
            {
                // Telerik.WinControls.UI.Export.ExportToExcelML htmlexport = new Telerik.WinControls.UI.Export.ExportToExcelML(radPivotGrid_StockPositionPivot);
                //  htmlexport.RunExport(sf.FileName);


                PivotGridSpreadExport spreadExport = new PivotGridSpreadExport(radPivotGrid_StockPositionPivot);
                spreadExport.RunExport(@"..\..\exported-file.xlsx", new SpreadExportRenderer());
            }
        }

 

the red marked position is throwing an exception, and code suggestion is asking to create a new class to implement SpreadExortRenderer I am not sure how it can be done, any help will be appreciated. TIA

Dess | Tech Support Engineer, Principal
Telerik team
 answered on 06 Mar 2023
Narrow your results
Selected tags
Tags
GridView
General Discussions
Scheduler and Reminder
Treeview
Dock
RibbonBar
Themes and Visual Style Builder
ChartView
Calendar, DateTimePicker, TimePicker and Clock
Buttons, RadioButton, CheckBox, etc
DropDownList
ComboBox and ListBox (obsolete as of Q2 2010)
ListView
Chart (obsolete as of Q1 2013)
Form
PageView
MultiColumn ComboBox
TextBox
RichTextEditor
Menu
PropertyGrid
RichTextBox (obsolete as of Q3 2014 SP1)
Panelbar (obsolete as of Q2 2010)
Tabstrip (obsolete as of Q2 2010)
MaskedEditBox
CommandBar
PdfViewer and PdfViewerNavigator
ListControl
Carousel
Diagram, DiagramRibbonBar, DiagramToolBox
Panorama
GanttView
New Product Suggestions
Toolstrip (obsolete as of Q3 2010)
AutoCompleteBox
Label
VirtualGrid
ContextMenu
Spreadsheet
Panel
Visual Studio Extensions
TitleBar
Documentation
SplitContainer
Map
DesktopAlert
ProgressBar
Rotator
TrackBar
MessageBox
CheckedDropDownList
SpinEditor
StatusStrip
CheckedListBox
Wizard
ShapedForm
SyntaxEditor
TextBoxControl
LayoutControl
DateTimePicker
CollapsiblePanel
Conversational UI, Chat
CAB Enabling Kit
TabbedForm
DataEntry
GroupBox
ScrollablePanel
WaitingBar
ImageEditor
ScrollBar
Tools - VSB, Control Spy, Shape Editor
BrowseEditor
DataFilter
ColorDialog
FileDialogs
Gauges (RadialGauge, LinearGauge, BulletGraph)
ApplicationMenu
RangeSelector
CardView
WebCam
BindingNavigator
PopupEditor
RibbonForm
Styling
TaskBoard
Barcode
ColorBox
Callout
PictureBox
VirtualKeyboard
FilterView
Accessibility
DataLayout
NavigationView
ToastNotificationManager
ValidationProvider
CalculatorDropDown
Localization
TimePicker
FontDropDownList
Licensing
BreadCrumb
ButtonTextBox
LocalizationProvider
Dictionary
Overlay
Security
Separator
SparkLine
TreeMap
StepProgressBar
SplashScreen
ToolbarForm
NotifyIcon
Rating
TimeSpanPicker
BarcodeView
Calculator
OfficeNavigationBar
Flyout
TaskbarButton
HeatMap
SlideView
PipsPager
AIPrompt
+? more
Top users last month
Mark
Top achievements
Rank 1
Yurii
Top achievements
Rank 1
Leland
Top achievements
Rank 2
Iron
Iron
Iron
Hon
Top achievements
Rank 1
Iron
Deltaohm
Top achievements
Rank 3
Bronze
Iron
Iron
Want to show your ninja superpower to fellow developers?
Top users last month
Mark
Top achievements
Rank 1
Yurii
Top achievements
Rank 1
Leland
Top achievements
Rank 2
Iron
Iron
Iron
Hon
Top achievements
Rank 1
Iron
Deltaohm
Top achievements
Rank 3
Bronze
Iron
Iron
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?