Telerik Forums
UI for WPF Forum
4 answers
163 views
Hello,

I'm evaluating telerik controls now, and my company will purchase in this month.

I want to know how to save multiple diagram pages with MVVM. (You can see this scenario in a attached screenshot)

Your document and sample is only showing "RadDiagram.Save()" to save a diagram, but my application is generating  a diagram dynamically for each tab content.

In this case, SerializableGraphSource doesn't know what diagram is connected with it.
And a diagram instance will be destroyed and recreated when tab control selection is changed.

Should I make my own save/load functions for this? 
I would appreciate if you give me some advice.

Thank you.
Hyunho
Top achievements
Rank 1
 answered on 24 May 2013
1 answer
132 views
Hi,
Is it possible to center and zoom in the diagram to a particular shape?

I've been trying to use a shape's Position as a parameter in the Diagram's ZoomIn() function, but it's not working as expected. When I first zoom to a shape, that shape is correctly centered in view. Subsequent zooms to other shapes don't work as well - the view is completely off. I guess ZoomIn() doesn't use the same coordinate system as Diagram Shapes, so the Position is something different at different zoom levels.

Maybe there's a "FocusOnShape()" function that I haven't yet found?
Vivek
Top achievements
Rank 1
 answered on 23 May 2013
2 answers
208 views
I have a Cartesian chart as follows:

<telerik:RadCartesianChart x:Name="chart" Grid.Column="0">
    <telerik:RadCartesianChart.Series>
        <telerik:BarSeries ItemsSource="{Binding DataItems}" ValueBinding="Value" CategoryBinding="DayPeriod" >
            <telerik:BarSeries.PointTemplate>
                <DataTemplate>
                    <Rectangle Fill="{Binding Converter={StaticResource BrushConverter}, ConverterParameter={StaticResource brushes}}"/>
                </DataTemplate>
            </telerik:BarSeries.PointTemplate>
        </telerik:BarSeries>
    </telerik:RadCartesianChart.Series>
    <telerik:RadCartesianChart.VerticalAxis>
        <telerik:LinearAxis Minimum="{Binding MinValue}" Maximum="{Binding MaxValue}" MajorStep="{Binding StepSize}" LabelStyle="{StaticResource axisLabelStyle}" />
    </telerik:RadCartesianChart.VerticalAxis>
    <telerik:RadCartesianChart.HorizontalAxis>
        <telerik:CategoricalAxis LabelFitMode="Rotate" LabelInterval="2"/>
    </telerik:RadCartesianChart.HorizontalAxis>
</telerik:RadCartesianChart>

I'm setting the colour of each individual Bar in the BarSeries via an IValueConverter (blue for positive, red for negative) using a BrushCollection defined in the UserControl's resources passed into the Value Converted.
It works very nicely!
The Chart is bount to an ObservableCollection<t> of items implemention INotofyPropertyChanged. When the values change, the graph does indeed update - but it never calls the Color Converter and it the value goes from - to + or the other way around it ends up with the wrong colour.

I can't see how to force this update. Is there a way?

Thanks -



svs
Top achievements
Rank 1
 answered on 23 May 2013
6 answers
649 views
Hello Telerik,


How could I make the resizing of the diagram shapes keep the aspect ratio?

Thanks in advance,
Metanous
Davide
Top achievements
Rank 1
 answered on 23 May 2013
3 answers
189 views
In my MVVM application, there is a RadTimeBar hosting a RadAreaSparkline to give the user an overview of the data.  When a period of time is selected, the SelectionStart and SelectionEnd values are used to query a detailed set of data that is then displayed in a RadTimeline.

After the selection is made, I would like the RadTimeline to have its PeriodStart/End set to match the SelectionStart/End times of the RadTimeBar.  This functionality is working.

At the same time that the RadTimeline has its PeriodStart/End set, I would like to set its VisiblePeriodStart/End to change to show the whole period.  Once this has been done, however, the user should be able to zoom the RadTimeline as normal.

The properties for the RadTimeBar and RadTimeline are bound to properties on my ViewModel.  However, what ends up happening is that after changing the PeriodStart/End, my changes to VisiblePeriodStart/End are overridden in TimeBarBase.CoerceVisiblePeriod(), as my calls to set VisiblePeriodStartart/End are being done before the PeriodStart/End DependencyProperty have been properly updated.

So what ends up happening is that sometimes I get what I want: i.e.VisiblePeriodStart/End being the same as PeriodStart/End, but other times, VisiblePeriodStart/End are set to the PREVIOUS values of PeriodStart/End.

Is there a proper set of steps that I am missing to make this work?

Thanks for your help

Tsvetie
Telerik team
 answered on 23 May 2013
3 answers
198 views
Hi there,

my problem is I have a grid view, and I have tons of login in xaml which perform the grouping and aggregate function, some of the group header/footer may have a DataTemplate to host the data. When I export the grid using the native Export function, I have the following issue:

1. I lost the Group Header, the column I am used to group is not shown in UI and I disallow use to change the grouping
2. I lost the ColumnGroups
3. Some of the cell is incorrect datatype (e.g. number and was interpreted as date in Excel)
4. All the template data cannot be displayed, and what's generated is the datatype instead of the string value on the grid (same as copy from the grid directly using Ctrl-C)

Any help will be appreciated!

Here are some examples of the xaml:

1. Grid Definition
<telerik:RadGridView Name="GridViewMyGrid"                                          
     ItemsSource="{Binding MyCollection}" 
     AutoGenerateColumns="False" 
     IsReadOnly="True"
     CanUserFreezeColumns="False"
     GroupRenderMode="Flat"
     ShowColumnFooters="True"
     ShowGroupFooters="True"
     AutoExpandGroups="True"
     IsFilteringAllowed="False"
     ShowGroupPanel="False" 
     FrozenColumnCount="2" 
     SelectionMode="Extended" 
     >

2. Column Group
<telerik:RadGridView.ColumnGroups>
    <telerik:GridViewColumnGroup  Name="Group1ColumnGroup" 
                            Header="Group1">
        <telerik:GridViewColumnGroup.HeaderTemplate>
            <DataTemplate>
                <TextBlock Text="Group1" 
                        TextAlignment="Center" 
                        FontWeight="Bold"></TextBlock>
            </DataTemplate>
        </telerik:GridViewColumnGroup.HeaderTemplate>
    </telerik:GridViewColumnGroup>


3. Column (I have tons of column and just show two here, the 1st is used for grouping)
<telerik:RadGridView.Columns>                            
    <telerik:GridViewDataColumn DataMemberBinding="{Binding GroupName}" ShowColumnWhenGrouped="False" />
    <telerik:GridViewDataColumn Header="Item1"
                                DataMemberBinding="{Binding Item1}">                            
        <telerik:GridViewDataColumn.AggregateFunctions>
            <telerik:FirstFunction/>
        </telerik:GridViewDataColumn.AggregateFunctions>
        <telerik:GridViewDataColumn.GroupFooterTemplate>
            <DataTemplate>
                <TextBlock FontWeight="Bold">
                    <Run Text="Subtotal "/>
                    <Run Text="{Binding Value.GroupName}"/>
                </TextBlock>                                        
            </DataTemplate>
        </telerik:GridViewDataColumn.GroupFooterTemplate>
        <telerik:GridViewColumn.Footer>
            <TextBlock FontWeight="Bold">
                <Run Text="Asset Total"/>
            </TextBlock>
        </telerik:GridViewColumn.Footer>
    </telerik:GridViewDataColumn>


And here is the method in the code behind to export:

 

private void ButtonExportStrats_OnClick(object sender, RoutedEventArgs e)
{
    var grid = GridViewMyGrid;            
    var dialog = new SaveFileDialog();
    dialog.DefaultExt = "*.xlsx";
    dialog.Filter = "Excel Workbook (*.xlsx)|*.xlsx";
    if (dialog.ShowDialog() == true)
    {
        Workbook book = null;
        using (var stream = new MemoryStream())
        {
            grid.Export(stream, new GridViewExportOptions()
            {
                Format = ExportFormat.Csv,
                ShowColumnFooters = grid.ShowColumnFooters,
                ShowColumnHeaders = grid.ShowColumnHeaders,
                ShowGroupFooters = grid.ShowGroupFooters
            });
            stream.Position = 0;
            book = new CsvFormatProvider().Import(stream);
            if (book != null)
            {
                var provider = new XlsxFormatProvider();
                using (var output = dialog.OpenFile())
                {
                    provider.Export(book, output);
                }
            }
        }
    }
}
Yoan
Telerik team
 answered on 23 May 2013
4 answers
293 views
Hi,

I tested the code of samples "Paint with MVVM".
All works good but how to add sub Items to a DropDownsButton?
I tryed a lot of strategies without success...

Thank's,
marc.
Pavel R. Pavlov
Telerik team
 answered on 23 May 2013
3 answers
360 views
Is it possible to use this control with MVVM?  I don't think it's possible but figured I would ask the experts.  Thanks.
Zarko
Telerik team
 answered on 23 May 2013
1 answer
97 views
Good Day,

According to the telerik demo on PDF integration for the book control, you must import the pdf to a RadFixedDocument, then set the itemssource of the book to RadFixedDocument.Pages. After attempting to bind the itemssource to the RadFixedDocument.Pages, it shows blank pages with "Telerik.Windows.Documents.Fixed.Model.RadFixedPage" in them.

I had even tried to duplicate the example in the demo and I'm still getting the same outcome.

Is there a way to solve this while still adhering to the MVVM pattern?

Thanks.
Tina Stancheva
Telerik team
 answered on 23 May 2013
1 answer
318 views

I have a RadGridView which contains GridViewComboBoxColumn as column.

Let consider RadGridView having ItemsSource as ObservableCollection<Product> and GridViewComboBoxColumn ItemsSource is List.

I want to set the GridViewComboBoxColumn SelectedItem property based on property in RadGridView ItemsSource i.e based on ProductTypeId in item/row/Product of ItemsSource/ObservableCollection<Product>.

However Product class has property ProductTypeId of type int and not ProductType object as property.

So how can I set GridViewComboBoxColumn SelectedItem so that it display value of Product.ProductTypeId as selected. And also I want to bind SeletedItem with Mode = TwoWay so that whenever ComboBox SelectedItem changes it will be reflected in RadGridView 
's ItemsSource.

One more thing the ProductId name is different in Product (Bound to RadGridView) class as well as ProductType class. However I can change this to be the same. Current it's like ProductType.Id and Product.TypeId.

Any help would be much appreciated.

Thanks.

Max
Top achievements
Rank 1
 answered on 23 May 2013
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
PersistenceFramework
DataPager
Styling
TimeBar
OutlookBar
TransitionControl
Book
FileDialogs
ToolBar
ColorPicker
TimePicker
SyntaxEditor
MultiColumnComboBox
VirtualGrid
Wizard
ExpressionEditor
NavigationView (Hamburger Menu)
DesktopAlert
WatermarkTextBox
BarCode
SpellChecker
DataServiceDataSource
EntityFrameworkDataSource
RadialMenu
ChartView3D
Data Virtualization
BreadCrumb
ProgressBar
Sparkline
LayoutControl
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
PasswordBox
Rating
SplashScreen
Accessibility
Callout
CollectionNavigator
Localization
AutoSuggestBox
VirtualKeyboard
HighlightTextBlock
Security
TouchManager
StepProgressBar
Badge
OfficeNavigationBar
ExpressionParser
CircularProgressBar
SvgImage
PipsPager
SlideView
AI Coding Assistant
+? more
Top users last month
Rob
Top achievements
Rank 3
Bronze
Iron
Iron
Sergii
Top achievements
Rank 1
Iron
Iron
Dedalus
Top achievements
Rank 1
Iron
Iron
Lan
Top achievements
Rank 1
Iron
Doug
Top achievements
Rank 1
Want to show your ninja superpower to fellow developers?
Top users last month
Rob
Top achievements
Rank 3
Bronze
Iron
Iron
Sergii
Top achievements
Rank 1
Iron
Iron
Dedalus
Top achievements
Rank 1
Iron
Iron
Lan
Top achievements
Rank 1
Iron
Doug
Top achievements
Rank 1
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?