Telerik Forums
UI for WPF Forum
1 answer
131 views
I have a RadBook which is loaded with a RadDocument. Currently my RadBook has fixed width and height, but this is not ideal for my application. What would improve the user experience is that if the RadBook is resized, then the pages and content are resized.

Is this something that the RadDocument within the RadBook can handle?
Petar Mladenov
Telerik team
 answered on 21 Apr 2011
5 answers
118 views
i wanted to ask if it is possible for us to have 2 tileView in a single xaml?
if yes, is there any solution for this?
I've tried to bind it to different content template, yet it failed.
Petar Mladenov
Telerik team
 answered on 21 Apr 2011
2 answers
146 views
Just wondering what it the easiest way to color-code countries? What do I do if I simply want to draw Russia in red color using OpenStreetMap provider?
Andrew
Top achievements
Rank 1
 answered on 20 Apr 2011
0 answers
126 views
Hi,

I have a collection of objects which I want to bind to a RadGridView. The class of the objects is looking like that (minimum code needed to understand) where I have 1 property and 1 array of values which :

public class AttributeEntry : INotifyPropertyChanged
    {
        public string Code { get; set; }
        private string[] _values;
        public string[] Values
        {
            get { return _values; }
            set { _values = value; }
        }
        public string this[int index]
        {
            get { return _values[index]; }
            set
            {
                _values[index] = value;
                if (PropertyChanged != null)
                    PropertyChanged(this, new PropertyChangedEventArgs(Binding.IndexerName));
            }
        }

        public event PropertyChangedEventHandler PropertyChanged;
    }

Is someone know a (simple) way, using the patern MVVM,  to have a RadGridView with some columns defined (in my case corresponding to the 'Code' property) and some columns "autogenerated" with each columns corresponding to the elements of a collection (in my case the elements of the array 'Values". If I have 7 values in my collection, I should have 7 "autogenerated" columns).
Philippe
Top achievements
Rank 1
 asked on 20 Apr 2011
1 answer
140 views
Hello!

I have a Grid with an activated InsertRow (ShowInsertRow=True) and a ComboBoxColumn that is readonly.
The Property bound to the SelectedValue of the ComboBox should only be set once a new item is inserted,
so i need the ComboBox to be editable in the InsertRow.
By default the ComboBox of the InsertRow inherits the Template of the Column and therefore is not editable.

How can I make that ComboBox editable, are there simple options as hooking a trigger ?
Is there a proper way to do it in Xaml (i'd like to avoid code behind) ?

Thank You.
Maya
Telerik team
 answered on 20 Apr 2011
1 answer
80 views
I saw the bug where the content doesnt fill the expander, but there is another issue.

When you click to expand, the content displays immediately instead of after the expander has opened.

Where do I set the delay?
Hristo
Telerik team
 answered on 20 Apr 2011
3 answers
316 views
I'm using Blend and MVVM so I'd like to learn how to use radChart to make a simple Pie chart.
I thought I'd start with the XMAL mock up and bind it later.
All I need to do is preset 3 categories, 3 slices of pie and set the background color (fixed per slice) and show the percents of each slice as I got. The number of slices if fixed at 3..

This sample does all that (except color and percent) Note: thanks to whomever I stole it from..

Any advice?
Thanks  Pat NH USA

  <telerik:RadChart Name="Chart"
                    BorderBrush="#FF001900"
                    BorderThickness="2">                   
                <telerik:RadChart.DefaultView>
                    <telerik:ChartDefaultView>  
                        <telerik:ChartDefaultView.ChartLegend>
                            <telerik:ChartLegend
                                x:Name="ChartLegend"
                                UseAutoGeneratedItems="True" />
                        </telerik:ChartDefaultView.ChartLegend>
                        <telerik:ChartDefaultView.ChartArea>
                            <telerik:ChartArea
                                Name="ChartArea"
                                LegendName="ChartLegend"                                 
                                ClipToBounds="False" >
                                    <telerik:ChartArea.DataSeries>
                                    <telerik:DataSeries>
                                        <telerik:DataSeries.Definition>
                                                <telerik:PieSeriesDefinition></telerik:PieSeriesDefinition>
                                        </telerik:DataSeries.Definition>
                                        <telerik:DataPoint
                                            YValue="15"                                          
                                            LegendLabel="CATAGORY1" />
                                        <telerik:DataPoint
                                            YValue="9"
                                            LegendLabel="CATAGORY2"
                                                Label="" />
                                        <telerik:DataPoint
                                            YValue="12"
                                            LegendLabel="CATAGORY3" />
                                    </telerik:DataSeries>
                                </telerik:ChartArea.DataSeries>
                            </telerik:ChartArea>
                        </telerik:ChartDefaultView.ChartArea>
                    </telerik:ChartDefaultView>
                </telerik:RadChart.DefaultView>
                </telerik:RadChart>
Sia
Telerik team
 answered on 20 Apr 2011
4 answers
130 views
Hi,

I am using a Telerik RadGridView controls for my WPF Windows application.

My requirement is I want to export data from Hierarchical RadGridView to Excel. But, while exporting I am getting few errors as attached.

Any quick help on this will be highly appreciated.

Thanks & Regards,
Hirak
    private void ExporttoExcel_Click(object sender, RoutedEventArgs e)
        {
            //RadGridNonMarketableSummary.Export(
 
            Telerik.Windows.Controls.ExportFormat format = Telerik.Windows.Controls.ExportFormat.Html;
            System.Globalization.CultureInfo cultureInfo = new System.Globalization.CultureInfo("nb-NO");
 
            SaveFileDialog dialog = new SaveFileDialog()
            {
                DefaultExt = "xls",
                Filter = String.Format("{1} files (*.{0})|*.{0}|All files (*.*)|*.*", "xls", "Excel"),
                FilterIndex = 1
            };
 
            if (dialog.ShowDialog() == true)
            {
                using (Stream stream = dialog.OpenFile())
                {
                    Telerik.Windows.Controls.GridViewExportOptions exportOptions = new Telerik.Windows.Controls.GridViewExportOptions();
 
                    //RadGridNonMarketableSummary exportOptions = new RadGridNonMarketableSummary();
 
                   // RadGridView exportOptions = new GridView();
 
                    
                    exportOptions.Format = format;
                    exportOptions.ShowColumnFooters = true;
                    exportOptions.ShowColumnHeaders = true;
                    exportOptions.ShowGroupFooters = true;
                    exportOptions.ShowColumnHeaders = true;
                     
                    exportOptions.Culture = cultureInfo;
                     
                     
 
                     
                    RadGridNonMarketableSummary.Export(stream, exportOptions);
                }
            }
        }
 
 
 private void RadGridNonMarketableSummary_ElementExporting(object sender, Telerik.Windows.Controls.GridViewElementExportingEventArgs e)
        {
            if (e.Element == Telerik.Windows.Controls.ExportElement.HeaderRow || e.Element == Telerik.Windows.Controls.ExportElement.FooterRow
               || e.Element == Telerik.Windows.Controls.ExportElement.GroupFooterRow)
            {
                //e.Background = HeaderBackgroundPicker.SelectedColor;
               // e.Foreground = HeaderForegroundPicker.SelectedColor;
                e.Background = Colors.LightGray;
                e.Foreground = Colors.Blue;
                e.FontSize = 20;
                e.FontWeight = FontWeights.Bold;
            }
            else if (e.Element == Telerik.Windows.Controls.ExportElement.Row)
            {
                //e.Background = RowBackgroundPicker.SelectedColor;
                //e.Foreground = RowForegroundPicker.SelectedColor;
                e.Background = Colors.LightGray;
                e.Foreground = Colors.Blue;
            }
            else if (e.Element == Telerik.Windows.Controls.ExportElement.Cell &&
                e.Value != null && e.Value.Equals("Chocolade"))
            {
                e.FontFamily = new FontFamily("Verdana");
                e.Background = Colors.LightGray;
                e.Foreground = Colors.Blue;
            }
            else if (e.Element == Telerik.Windows.Controls.ExportElement.GroupHeaderRow)
            {
                e.FontFamily = new FontFamily("Verdana");
                e.Background = Colors.LightGray;
                e.Height = 30;
            }
            else if (e.Element == Telerik.Windows.Controls.ExportElement.GroupHeaderCell &&
                e.Value != null && e.Value.Equals("Chocolade"))
            {
                e.Value = "MyNewValue";
            }
            else if (e.Element == Telerik.Windows.Controls.ExportElement.GroupFooterCell)
            {
                Telerik.Windows.Controls.GridViewDataColumn column = e.Context as Telerik.Windows.Controls.GridViewDataColumn;
                Telerik.Windows.Data.QueryableCollectionViewGroup qcvGroup = e.Value as Telerik.Windows.Data.QueryableCollectionViewGroup;
 
                if (column != null && qcvGroup != null && column.AggregateFunctions.Count() > 0)
                {
                    e.Value = GetAggregates(qcvGroup, column);
                }
            }
        }
 
        private string GetAggregates(Telerik.Windows.Data.QueryableCollectionViewGroup group, Telerik.Windows.Controls.GridViewDataColumn column)
        {
            List<string> aggregates = new List<string>();
 
            foreach (Telerik.Windows.Data.AggregateFunction f in column.AggregateFunctions)
            {
                foreach (Telerik.Windows.Data.AggregateResult r in group.AggregateResults)
                {
                    if (f.FunctionName == r.FunctionName && r.FormattedValue != null)
                    {
                        aggregates.Add(r.FormattedValue.ToString());
                    }
                }
            }
 
            return String.Join(",", aggregates.ToArray());
        }
 
in XAML page I am using the following code:
 
<UserControl x:Class="SSG_TradeExpress.View.Trade.TradeNonMarketable"
             xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
             xmlns:telerikControls="clr-namespace:Telerik.Windows.Controls;assembly=Telerik.Windows.Controls"
             xmlns:Converters="clr-namespace:SSG_TradeExpress.View.Converters"
            >
    <UserControl.Resources>
        <Converters:RangeToColorConverter x:Key="RangeConverter"></Converters:RangeToColorConverter>
    </UserControl.Resources>
 
    <Grid x:Name="GridNonMarketable" >
        <telerik:RadGridView Grid.Row="0" x:Name="RadGridNonMarketableSummary" ElementExporting="RadGridNonMarketableSummary_ElementExporting" RowLoaded="RadGridNonMarketableSummary_RowLoaded" Loaded="RadGridNonMarketableSummary_Loaded"  telerikControls:StyleManager.Theme="Office_Blue" IsReadOnly="True"  ItemsSource="{Binding TradeNonMarketableData.NonMarketableSummaryModel}" IsFilteringAllowed="False"  CanUserFreezeColumns="False"  AutoGenerateColumns="False" AutoExpandGroups="True"  >
            <telerik:RadGridView.ChildTableDefinitions>
                <telerik:GridViewTableDefinition   />
            </telerik:RadGridView.ChildTableDefinitions>
            <telerik:RadGridView.RowStyle>
                <Style TargetType="{x:Type telerik:GridViewRow}">
                    <Setter Property="IsExpanded" Value="True"/>
                </Style>
            </telerik:RadGridView.RowStyle>
            <telerik:RadGridView.Columns>
                <telerik:GridViewDataColumn Header="Investment Category Name" DataMemberBinding="{Binding InvestmentCategoryName}" IsVisible="False"   />
                <telerik:GridViewDataColumn Header="Asset Class Name" DataMemberBinding="{Binding AssetClassName}"  IsVisible="False"  />
                <telerik:GridViewDataColumn Header="Sbu" DataMemberBinding="{Binding SbuName}" Width="125" TextWrapping="Wrap"/>
                <telerik:GridViewDataColumn Header="Total Value" DataMemberBinding="{Binding TotalValue, StringFormat={}{0:c}}" HeaderTextAlignment="Right" TextAlignment="Right" Width="90" TextWrapping="Wrap">
                    <telerik:GridViewDataColumn.AggregateFunctions>
                        <telerik:SumFunction Caption="Total :" ResultFormatString="{}{0:c}" />
                    </telerik:GridViewDataColumn.AggregateFunctions>
                </telerik:GridViewDataColumn>
                <telerik:GridViewDataColumn Header="Target Min" DataMemberBinding="{Binding TargetMin, StringFormat={}{0:n2}}"  HeaderTextAlignment="Right" TextAlignment="Right" Width="90" TextWrapping="Wrap"/>
                <telerik:GridViewDataColumn Header="Target Max" DataMemberBinding="{Binding TargetMax, StringFormat={}{0:n2}}"  HeaderTextAlignment="Right" TextAlignment="Right" Width="90" TextWrapping="Wrap"/>
                <telerik:GridViewDataColumn Header="Target Total" DataMemberBinding="{Binding TargetTotal, StringFormat={}{0:n2}}"  HeaderTextAlignment="Right" TextAlignment="Right" Width="90" TextWrapping="Wrap"/>
                <telerik:GridViewDataColumn Header="Total Actual" DataMemberBinding="{Binding TotalActual, StringFormat={}{0:n2}}"  HeaderTextAlignment="Right" TextAlignment="Right" Width="90" TextWrapping="Wrap"/>
                <telerik:GridViewDataColumn Header="Variance" DataMemberBinding="{Binding Variance, StringFormat={}{0:n2}}"  HeaderTextAlignment="Right" TextAlignment="Right" Width="90" TextWrapping="Wrap">
                    <telerik:GridViewDataColumn.CellStyle>
                        <Style TargetType="telerik:GridViewCell">
                            <Setter Property="Foreground" Value="{Binding TotalRange, Converter={StaticResource RangeConverter}}" />
                        </Style>
                    </telerik:GridViewDataColumn.CellStyle>
                </telerik:GridViewDataColumn>
                <telerik:GridViewDataColumn Header="Total Range" DataMemberBinding="{Binding TotalRange}"  HeaderTextAlignment="Right" TextAlignment="Right" Width="90" TextWrapping="Wrap">
                    <telerik:GridViewDataColumn.CellStyle>
                        <Style TargetType="telerik:GridViewCell">
                            <Setter Property="Foreground" Value="{Binding TotalRange, Converter={StaticResource RangeConverter}}" />
                        </Style>
                    </telerik:GridViewDataColumn.CellStyle>
                </telerik:GridViewDataColumn>
            </telerik:RadGridView.Columns>
            <telerik:RadGridView.HierarchyChildTemplate>
                <DataTemplate>
                    <telerik:RadGridView x:Name="RadGridNonMarketableDetail" telerikControls:StyleManager.Theme="Windows7" CanUserFreezeColumns="False" AutoGenerateColumns="False" IsFilteringAllowed="False" ItemsSource="{Binding NonMarketableDetailModel}"  ShowGroupPanel="False" IsReadOnly="True">
                        <telerik:RadGridView.Columns>
                            <telerik:GridViewDataColumn DataMemberBinding="{Binding FundName}" Header="Fund Name" Width="200" TextWrapping="Wrap"/>
                            <telerik:GridViewDataColumn  Header="Value / Unadjusted Value" HeaderTextAlignment="Right" TextAlignment="Right" Width="150" TextWrapping="Wrap" >
                                <telerik:GridViewDataColumn.CellTemplate>
                                    <DataTemplate>
                                        <StackPanel Orientation="Horizontal">
                                            <TextBlock Text="{Binding Value,StringFormat={}{0:c}}"></TextBlock>
                                            <TextBlock Text=" / "></TextBlock>
                                            <TextBlock Text="{Binding UnAdjustedValue,StringFormat={}{0:c}}"></TextBlock>
                                        </StackPanel>
                                    </DataTemplate>
                                </telerik:GridViewDataColumn.CellTemplate>
                            </telerik:GridViewDataColumn>
 
                            <telerik:GridViewDataColumn DataMemberBinding="{Binding ValueDate, StringFormat={}{0:d}}" Header="Value Date" HeaderTextAlignment="Right" TextAlignment="Right" Width="90" TextWrapping="Wrap"/>
                            <telerik:GridViewDataColumn DataMemberBinding="{Binding TotalActual, StringFormat={}{0:n3}}" Header="Total Actual" HeaderTextAlignment="Right" TextAlignment="Right" Width="90" TextWrapping="Wrap"/>
                            <telerik:GridViewDataColumn DataMemberBinding="{Binding FundCode}" Header="Fund Code" HeaderTextAlignment="Right" TextAlignment="Right" Width="90" TextWrapping="Wrap"/>
                            <telerik:GridViewDataColumn DataMemberBinding="{Binding CalledToDate, StringFormat={}{0:c}}" Header="Called To Date" HeaderTextAlignment="Right" TextAlignment="Right" Width="90" TextWrapping="Wrap"/>
                            <telerik:GridViewDataColumn DataMemberBinding="{Binding Commitment, StringFormat={}{0:c}}" Header="Commitment" HeaderTextAlignment="Right" TextAlignment="Right" Width="90" TextWrapping="Wrap"/>
                            <telerik:GridViewDataColumn DataMemberBinding="{Binding TotalDistributions, StringFormat={}{0:c}}" Header="Total Distributions" HeaderTextAlignment="Right" TextAlignment="Right" Width="90" TextWrapping="Wrap"/>
                            <telerik:GridViewDataColumn DataMemberBinding="{Binding ToBeCalled, StringFormat={}{0:c}}" Header="To Be Called" HeaderTextAlignment="Right" TextAlignment="Right" Width="90" TextWrapping="Wrap"/>
                        </telerik:RadGridView.Columns>
                    </telerik:RadGridView>
                </DataTemplate>
            </telerik:RadGridView.HierarchyChildTemplate>
        </telerik:RadGridView>
        <!--<telerik:RadButton Name="ExporttoExcel" Margin="722,-33,0,0" Style="{DynamicResource NormalButtonStyle}" Content="Export to Excel"  Command="{Binding ExportToExcelCommand}" Width="102" HorizontalAlignment="Right" VerticalAlignment="Top" Height="27" CommandParameter="{Binding}"/>-->
        <telerik:RadButton Name="ExporttoExcel" Margin="722,-33,0,0" Style="{DynamicResource NormalButtonStyle}" Content="Export to Excel" Width="102" HorizontalAlignment="Right" VerticalAlignment="Top" Height="27" Click="ExporttoExcel_Click"/>
    </Grid>
 
</UserControl>
hirak
Top achievements
Rank 1
 answered on 20 Apr 2011
5 answers
133 views
Hi,

I'm reading http://www.telerik.com/help/wpf/radchart-features-format-expressions.html. The bottom of the article displays a table of examples of format expressions, eg. {C2}, however I'm unable to find an article that definitively lists all of the format expressions that are available (I would have expected this list in this help article titled "Format Expressions"). I found an example of {D} for date and guessed {T} for time, but don't know what additional formatting options there are.

In particular, I'm trying to display the Y-value in a tooltip using region specific formatting delimiters. For example, while I'm able to use {0.0} to format a number with at least one integer digit and one place after the decimal point, the region I'm working in uses a comma as a decimal point delimiter. If I try to use {0,0}, I only get one integer digit in the tooltip with no "," and no digit after the decimal point.

What format expressions are available and can this information be added to the help (and I'm guessing this information is span across your chart control over different technologies).

I also don't know which circumstances I can use a token. For example, although the documentation at the top of the page seems to indicate that I can use the #LABEL and #LEGENDLABEL tokens in a tooltip, using it only displays the string "#LABEL" in the tooltip and using the #LEGENDLABEL token displays the raw, unformatted Y value in the tooltip. I'm looking to display the label of the series displayed in the legend along with the Y-value in the tooltip so that it is easy to distinguish which series you are hovering over when there are multiple series on the chart.

Kind regards,
Dave.
Evgenia
Telerik team
 answered on 20 Apr 2011
1 answer
166 views
Hello Telerik Team,

In control template i have wpf grid with four columns. And each column contains listbox. Each listbox contains 5 items. How do i use tabbing order?

I am setting OpenDropDownOnFocus="True"
Now when i press Tab key, RadCombobox closed.

Any help would be highly appreciated.

Regards,
Viral
Valeri Hristov
Telerik team
 answered on 20 Apr 2011
Narrow your results
Selected tags
Tags
GridView
General Discussions
Chart
RichTextBox
Docking
ScheduleView
ChartView
TreeView
Diagram
Map
ComboBox
TreeListView
Window
RibbonView and RibbonWindow
PropertyGrid
DragAndDrop
TabControl
TileView
Carousel
DataForm
PDFViewer
MaskedInput (Numeric, DateTime, Text, Currency)
AutoCompleteBox
DatePicker
Buttons
ListBox
GanttView
PivotGrid
Spreadsheet
Gauges
NumericUpDown
PanelBar
DateTimePicker
DataFilter
Menu
ContextMenu
TimeLine
Calendar
Installer and Visual Studio Extensions
ImageEditor
BusyIndicator
Expander
Slider
TileList
DataPager
PersistenceFramework
Styling
TimeBar
OutlookBar
TransitionControl
FileDialogs
Book
ToolBar
ColorPicker
TimePicker
MultiColumnComboBox
SyntaxEditor
VirtualGrid
NavigationView (Hamburger Menu)
Wizard
ExpressionEditor
WatermarkTextBox
DesktopAlert
BarCode
SpellChecker
DataServiceDataSource
EntityFrameworkDataSource
RadialMenu
ChartView3D
Data Virtualization
BreadCrumb
LayoutControl
ProgressBar
Sparkline
TabbedWindow
ToolTip
CloudUpload
ColorEditor
TreeMap and PivotMap
EntityFrameworkCoreDataSource (.Net Core)
HeatMap
Chat (Conversational UI)
VirtualizingWrapPanel
Calculator
NotifyIcon
TaskBoard
TimeSpanPicker
BulletGraph
Licensing
WebCam
CardView
DataBar
FilePathPicker
Callout
PasswordBox
SplashScreen
Localization
Rating
Accessibility
CollectionNavigator
AutoSuggestBox
Security
VirtualKeyboard
HighlightTextBlock
TouchManager
StepProgressBar
Badge
OfficeNavigationBar
ExpressionParser
CircularProgressBar
SvgImage
PipsPager
SlideView
AI Coding Assistant
+? more
Top users last month
Marco
Top achievements
Rank 4
Iron
Iron
Iron
Hiba
Top achievements
Rank 1
Iron
Iron
Rob
Top achievements
Rank 3
Bronze
Bronze
Iron
Max
Top achievements
Rank 1
Veteran
Iron
Alina
Top achievements
Rank 1
Want to show your ninja superpower to fellow developers?
Top users last month
Marco
Top achievements
Rank 4
Iron
Iron
Iron
Hiba
Top achievements
Rank 1
Iron
Iron
Rob
Top achievements
Rank 3
Bronze
Bronze
Iron
Max
Top achievements
Rank 1
Veteran
Iron
Alina
Top achievements
Rank 1
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?