or
<
Window
x:Class
=
"WpfApplication1.MainWindow"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
Title="MainWindow" Height="350" Width="525"
xmlns:telerik="http://schemas.telerik.com/2008/xaml/presentation"
xmlns:WpfApplication1="clr-namespace:WpfApplication1">
<
Grid
>
<
telerik:RadRibbonView
Name
=
"radRibbonView1"
>
<
telerik:RadRibbonTab
>
<
WpfApplication1:UserControl1
/
</
telerik:RadRibbonTab
>
</
telerik:RadRibbonView
>
</
Grid
>
</
Window
>
<
telerikChart:RadChart
x:Name
=
"radChartCompanyRevenue"
Width
=
"500"
Height
=
"350"
IsEnabled
=
"True"
>
<
telerikCharting:ChartDefaultView
>
<
telerikCharting:ChartDefaultView.ChartLegend
>
<
telerikCharting:ChartLegend
Visibility
=
"Collapsed"
/>
</
telerikCharting:ChartDefaultView.ChartLegend
>
<
telerikCharting:ChartDefaultView.ChartArea
>
<
telerikCharting:ChartArea
ItemClick
=
"ChartArea_ItemClick"
/>
</
telerikCharting:ChartDefaultView.ChartArea
>
</
telerikCharting:ChartDefaultView
>
<
telerikChart:RadChart.SeriesMappings
>
<
telerikCharting:SeriesMapping
>
<
telerikCharting:SeriesMapping.SeriesDefinition
>
<
telerikCharting:PieSeriesDefinition
>
</
telerikCharting:PieSeriesDefinition
>
</
telerikCharting:SeriesMapping.SeriesDefinition
>
<
telerikCharting:SeriesMapping.ItemMappings
>
<
telerikCharting:ItemMapping
DataPointMember
=
"XCategory"
FieldName
=
"Month"
/>
<
telerikCharting:ItemMapping
DataPointMember
=
"YValue"
FieldName
=
"Revenue"
></
telerikCharting:ItemMapping
>
</
telerikCharting:SeriesMapping.ItemMappings
>
</
telerikCharting:SeriesMapping
>
</
telerikChart:RadChart.SeriesMappings
>
</
telerikChart:RadChart
>
// constructor
public DrillDown_Report()
{
InitializeComponent();
BindCompanyRevenue();
}
private void ChartArea_ItemClick(object sender, Telerik.Windows.Controls.Charting.ChartItemClickEventArgs e)
{
CompanyRevenue_Event cr = e.DataPoint.DataItem as CompanyRevenue_Event;
MessageBox.Show(cr.Month + " " + cr.Revenue.ToString());
}
#region Company Revenue
private void BindCompanyRevenue()
{
radChartCompanyRevenue.ItemsSource = this.GetCompanyRevenue();
radChartCompanyRevenue.DefaultView.ChartTitle.Content = "Company Revenue";
radChartCompanyRevenue.DefaultView.ChartLegend.Visibility = System.Windows.Visibility.Collapsed;
radChartCompanyRevenue.DefaultView.ChartArea.ItemClick += new EventHandler<
Telerik.Windows.Controls.Charting.ChartItemClickEventArgs
>(ChartArea_ItemClick);
}
private List<
CompanyRevenue_Event
> GetCompanyRevenue()
{
List<
CompanyRevenue_Event
> companyRevenue = new List<
CompanyRevenue_Event
>();
companyRevenue.Add(new CompanyRevenue_Event(2011, "Jan", 189213.58));
companyRevenue.Add(new CompanyRevenue_Event(2011, "Feb", 179213.58));
companyRevenue.Add(new CompanyRevenue_Event(2011, "Mar", 180213.58));
companyRevenue.Add(new CompanyRevenue_Event(2011, "Apr", 184213.58));
return companyRevenue;
}
#endregion
Hi,
I want to collapse the hierarchy expand button (its border container to be accurate) so there will be no white space at the first column content when there is no hierarchy.
I saw that there is a property in the radTreeListView called HasHierarchy, but I cannot change its value (the set is not accessible).
I’ve managed to this in code:
var gridHierarchyBorder = treeListView.FindChildByName("PART_HierarchyIndent") as Border;
if (gridHierarchyBorder == null)
return;
gridHierarchyBorder.Visibility = Visibility.Collapsed;
But I guess there is a more efficient and elegant way to achieve this. Is there?