This is a migrated thread and some comments may be shown as answers.

RadGridView Aggregate Result

1 Answer 71 Views
General Discussions
This is a migrated thread and some comments may be shown as answers.
Ivy
Top achievements
Rank 1
Ivy asked on 14 Dec 2009, 10:32 AM
I am using the grouping functionality of RadGridVIew.  By dragging columns I was able to get columns' sum - displaying in this format

Column1 | Total: 89
Column2 | Total: 50

Now, what I need is to capture this result and place it in a Dictionary object wherein the key is the column name and the value is the Total count.  How can I capture the result and save it?

1 Answer, 1 is accepted

Sort by
0
Ivy
Top achievements
Rank 1
answered on 17 Dec 2009, 06:59 AM
found a solution:

 

public void BindChart(string aggregateFunction, GroupDescriptorCollection gridGroupDescriptors, object gridItemsSource, string[] dataSets)

 

{

RadChart1.DefaultView.ChartArea.AdditionalYAxes.Clear();

RadChart1.ItemsSource = Translate(gridItemsSource);

RadChart1.SeriesMappings.Clear();

 

ChartAggregateFunction aggFunct = (ChartAggregateFunction)Enum.Parse(typeof(ChartAggregateFunction), aggregateFunction, true);

 

 

foreach (string dataSet in dataSets)

 

{

 

SeriesMapping mapping = new SeriesMapping();

 

mapping.ItemMappings.Clear();

mapping.ItemMappings.Add(

new ItemMapping(dataSet, DataPointMember.YValue, aggFunct));

 

 

mapping.SeriesDefinition =

new BarSeriesDefinition();

 

#region

 

Assign Axis Y

 

 

//if (RadChart1.SeriesMappings.Count > 1)

 

 

//{

 

 

// RadChart1.DefaultView.ChartArea.AdditionalYAxes.Add(GenerateYAxis(dataSet));

 

 

// mapping.SeriesDefinition.AxisName = dataSet;

 

 

//}

 

#endregion

 

ChartGroupDescriptorCollection chartGroupDescriptors = new ChartGroupDescriptorCollection();

 

 

foreach (GroupDescriptor descriptor in gridGroupDescriptors)

 

mapping.GroupingSettings.GroupDescriptors.Add(

new ChartGroupDescriptor(descriptor.Member, descriptor.MemberType));

 

 

GroupDescriptor lastGroupDescriptor;

 

 

if (gridGroupDescriptors.Count > 0 && aggregateFunction.ToLower() != "none")

 

{

lastGroupDescriptor = gridGroupDescriptors[gridGroupDescriptors.Count - 1];

mapping.ItemMappings.Add(

new ItemMapping(lastGroupDescriptor.Member, DataPointMember.XCategory));

 

}

RadChart1.SeriesMappings.Add(mapping);

}

}

Tags
General Discussions
Asked by
Ivy
Top achievements
Rank 1
Answers by
Ivy
Top achievements
Rank 1
Share this question
or