Telerik Forums
UI for WPF Forum
3 answers
202 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
204 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
315 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
376 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
106 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
328 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
1 answer
214 views
I am using RadMap in a project that displays a large facility layout.  Users can pan/zoom the map to select, inspect, and modify equipment around the facility.  The use of RadMap's ZoomLevel, MinZoomLevel, and MaxZoomLevel are used to limit the user's zoom capabilities.

In this project, RadMap works great except for one issue.  Users constantly complain that the zoom increments are too large.  Two zooms in either direction make the map useless.  We are either looking at a postage stamp when zoomed out twice, or most of the equipment icons are off the screen when zoomed in a few times.

RadMap zoom levels are integer values.  I have seen other users ask if there is a way to use floating point zoom levels (such as "14.30").  The answer was always "No".

Are there any plans to add floating point zoom levels to RadMap in the future?  Are there any workarounds I could use in this case to make zooming more beneficial?
Andrey
Telerik team
 answered on 23 May 2013
8 answers
450 views
Hi,

I'm currently trying to display two datatypes in a single RadTreeListView. The first datatype, 'Desk', have only two properties: 'Name', and a property 'Books' containing the second datatype: 'Book'.

public class Desk
{
    public string Name { get; set; }
    public List<Book> Books { get; set; }
}
 
public class Book
{
    public string Name { get; set; }
    public string Location { get; set; }
    // Other stuff
}

I want to display a column 'Name' populated by both types, and a few other columns (in this example : 'Location') populated only for the child elements (Book).

Even though I wasn't able to create different templates for each types, the data could be binded since the property names are matching, and I can edit the Desk's properties. But the grid throws a 'Object does not match target type' exception when I try to edit a Book's properties.

<telerikGridView:RadTreeListView x:Name="RadTreeListView1"
                    AutoGenerateColumns="False"
                    IsReadOnly="False"
                    RowIndicatorVisibility="Collapsed"                                
                    ItemsSource="{Binding Path=Desks}">
    <telerikGridView:RadTreeListView.ChildTableDefinitions>
        <telerikGridView:TreeListViewTableDefinition ItemsSource="{Binding Path=Books}" />
    </telerikGridView:RadTreeListView.ChildTableDefinitions>
    <telerikGridView:RadTreeListView.Columns>                      
        <telerikGridView:GridViewDataColumn DataMemberBinding="{Binding Path=Name}" Header="Name" Width="150"/>
        <telerikGridView:GridViewDataColumn DataMemberBinding="{Binding Path=Description}" Header="Description" Width="*"/>
        <telerikGridView:GridViewDataColumn DataMemberBinding="{Binding Path=Location.Name}" Header="Location" Width="100"/>
        <telerikGridView:GridViewDataColumn DataMemberBinding="{Binding Path=Intention}" Header="Intention" Width="100"/>
        <telerikGridView:GridViewDataColumn DataMemberBinding="{Binding Path=TreatmentType}" Header="Treatment Type" Width="100"/>
        <telerikGridView:GridViewDataColumn DataMemberBinding="{Binding Path=AccountingTreatment}" Header="Accounting Treatment" Width="100"/>
        <telerikGridView:GridViewDataColumn DataMemberBinding="{Binding Path=IfrsType}" Header="Ifrs Type" Width="100"/>                       
    </telerikGridView:RadTreeListView.Columns>
</telerikGridView:RadTreeListView>

Am I doing something wrong? Is there a workaround for this problem?

(enclosed screenshot)
Nick
Telerik team
 answered on 23 May 2013
3 answers
307 views
Guys - I've run a profile on an app where we're only using your GridView, and are completely overriding your styles (based on your metro themes, bringing it back even more) and have noticed thousands of ResourceDictionaries instantiated which identify as internal to your DLLs - are you using hard-coded references, and do you have some form of resourcedictionary caching I might be missing? dll versions are 2013.1.220.40

Cheers, 
AC

Hristo
Telerik team
 answered on 23 May 2013
4 answers
253 views
Hi,

i use a RadDataForm in a DialogWindow. I want to open the Dialog, bind the ItemSource on the Dataform and now
I want to get the DataForm in Edit Mode.

I tried AutoEdit="true" this will open my DataForm in EditMode, but on click on the OK Button the DataForm ist still
in Edit Mode!

How can I open the DataForm in Edit mode?

Thanks
Best Regards
Rene
ITA
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
FileDialogs
Book
ToolBar
ColorPicker
TimePicker
MultiColumnComboBox
SyntaxEditor
VirtualGrid
Wizard
ExpressionEditor
NavigationView (Hamburger Menu)
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
PasswordBox
SplashScreen
Callout
Rating
Accessibility
CollectionNavigator
Localization
AutoSuggestBox
Security
VirtualKeyboard
HighlightTextBlock
TouchManager
StepProgressBar
Badge
OfficeNavigationBar
ExpressionParser
CircularProgressBar
SvgImage
PipsPager
SlideView
AI Coding Assistant
+? more
Top users last month
Bohdan
Top achievements
Rank 3
Iron
Iron
Iron
Rob
Top achievements
Rank 3
Bronze
Bronze
Iron
Elliot
Top achievements
Rank 1
Iron
Iron
Iron
Sunil
Top achievements
Rank 1
Cynthia
Top achievements
Rank 1
Iron
Iron
Iron
Want to show your ninja superpower to fellow developers?
Top users last month
Bohdan
Top achievements
Rank 3
Iron
Iron
Iron
Rob
Top achievements
Rank 3
Bronze
Bronze
Iron
Elliot
Top achievements
Rank 1
Iron
Iron
Iron
Sunil
Top achievements
Rank 1
Cynthia
Top achievements
Rank 1
Iron
Iron
Iron
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?