Telerik Forums
UI for WPF Forum
4 answers
135 views
Hi,

Trying to follow the example in your documentation of connecting the carousel to a dataset 

this.MyCarousel.ItemsSource = dsCarousel(); //My named dataset


I've created a dataset object using the 'Data Sources' option in VS2012. When I set the itemsource to the dataset name it's telling me datasource is a type but being used as a variable, which I understand.


this.RadCarousel1.ItemsSource = GetDataTable();

radCarousel1.DataMember = "Orders";
radCarousel1.ItemsSource = dataSet;


//MY CODE EXAMPLE BELOW

namespace WPFTest
{
    /// <summary>
    /// Interaction logic for MainWindow.xaml
    /// </summary>
    public partial class MainWindow : Window
    {
        public MainWindow()
        {
            InitializeComponent();

            this.MyCarousel.ItemsSource = dsCarousel();

        }
    }
}


What I don't understand is how exactly am I to interpret the example of assigning the dataset per the documentation? I can test and see data fill the dataset object using TableAdapter Config Wizard so I know it's connecting. But do I have to create this dataset completely in code to use it or am I missing or not understanding something very obvious. I'm new to windows programming and especially using WPF controls so I'm just trying to find my way here. Let me know if I've made sense at all?

Thanks in advance.

Tony








Tony
Top achievements
Rank 1
 answered on 20 Feb 2015
17 answers
713 views
Hello,

Is it possible to get Silverlight Movie Player ported to WPF ?
Pavel R. Pavlov
Telerik team
 answered on 20 Feb 2015
19 answers
305 views
Some of my users are seeing the group headers and aggregate functions get out of sync in a grid after expanding and collapsing a couple of times.  Groups will show the key and the details from that group but the aggregate results from another group.

This grid uses a group header template and the collapse all/ expand all functionality is in code using ExpandAllGroups() and CollapseAllGroups().  Is this a known issue?  (I am having trouble duplicating this on my machine but I have seen it happen on other machines)

Here is xaml for the grid:

<telerik:RadGridView DockPanel.Dock="Top" x:Name="grdAccrual" ItemsSource="{Binding EnterpriseAllocationRecords}" AutoGenerateColumns="False"
                                         IsFilteringAllowed="False" ShowGroupPanel="False" SelectionMode="Extended" ShowInsertRow="False" 
                                         ActionOnLostFocus="CommitEdit"  CanUserInsertRows="False" CanUserDeleteRows="False" CanUserReorderColumns="False"
                                         IsReadOnly="False" CanUserFreezeColumns="False" CanUserResizeColumns="False" CanUserSortColumns="False"
                                         RowIndicatorVisibility="Collapsed" AutoExpandGroups="True" EditTriggers="F2,CellClick"
                                         ScrollViewer.VerticalScrollBarVisibility="Auto" RowEditEnded="grdAccrual_RowEditEnded"
                                        RowHeight="27">
              
            <telerik:RadGridView.Columns>
                <!--<telerik:GridViewDataColumn Header="ATIG"  CellStyle="{StaticResource LeftAlignCell}" DataMemberBinding="{Binding TransactionCode}"  Width="65" IsReadOnly="True"></telerik:GridViewDataColumn>
                <telerik:GridViewDataColumn Header="Description"  CellStyle="{StaticResource LeftAlignCell}" DataMemberBinding="{Binding TransactionDescription}" IsReadOnly="True" Width="*" />-->
                <telerik:GridViewDataColumn Header="Ent" CellStyle="{StaticResource LeftAlignCell}" DataMemberBinding="{Binding EnterpriseCode}" IsFilterable="False" IsReadOnly="True" Width="50" />
                <telerik:GridViewDataColumn Header="Ent Desc" CellStyle="{StaticResource LeftAlignCell}" DataMemberBinding="{Binding EnterpriseDescription}" IsFilterable="False" IsReadOnly="True" Width="350" />
                <telerik:GridViewDataColumn Header="Cash/Inv" DataMemberBinding="{Binding SuggestedAccrualAmount}" DataFormatString="{}{0:f2}" IsFilterable="False" IsReadOnly="True" Width="70" >
                    <!--<telerik:GridViewDataColumn.Header>
                        <TextBlock Text="Cash/Inv Accrual" TextWrapping="Wrap" />
                    </telerik:GridViewDataColumn.Header>-->
                </telerik:GridViewDataColumn>
                <telerik:GridViewDataColumn Header="%" DataMemberBinding="{Binding AllocationPercent}" DataFormatString="{}{0:p2}" IsFilterable="False" Width="60">
                    <telerik:GridViewDataColumn.CellEditTemplate>
                        <DataTemplate>                            
                            <telerikInput:RadMaskedNumericInput x:Name="txtAllocationPercent" Mask="p3.2" 
                                                                SpinMode="None" IsClearButtonVisible="False" SelectionOnFocus="SelectAll"
                                                                KeyboardNavigation.TabNavigation="Local" TextMode="PlainText"                                                                
                                                                Validation.ErrorTemplate="{StaticResource TextBoxErrorTemplate}"  
                                                                 >
                                <telerikInput:RadMaskedNumericInput.Value>
                                    <Binding Path="AllocationPercent" Mode="TwoWay" UpdateSourceTrigger="LostFocus">
                                        <Binding.ValidationRules>
                                            <imKASHelper:PercentValidationRule Min="-100.00" Max="100.00" />
                                        </Binding.ValidationRules>
                                    </Binding>
                                </telerikInput:RadMaskedNumericInput.Value>
                            </telerikInput:RadMaskedNumericInput>
  
                        </DataTemplate>
                    </telerik:GridViewDataColumn.CellEditTemplate>
                </telerik:GridViewDataColumn>
                <telerik:GridViewDataColumn Header="Units" DataMemberBinding="{Binding Units}" DataFormatString="{}{0:f2}" IsFilterable="False" IsReadOnly="True" Width="70" ></telerik:GridViewDataColumn>
                <telerik:GridViewDataColumn Header="Weight" DataMemberBinding="{Binding Weight}" DataFormatString="{}{0:f2}" IsFilterable="False" IsReadOnly="True" Width="70" ></telerik:GridViewDataColumn>
                <telerik:GridViewDataColumn DataMemberBinding="{Binding Amount}" DataFormatString="{}{0:f2}" IsFilterable="False" Width="70" >
                    <telerik:GridViewDataColumn.Header>
                        <TextBlock Text="Amount" TextWrapping="Wrap" />
                    </telerik:GridViewDataColumn.Header>
                    <telerik:GridViewDataColumn.CellEditTemplate>
                        <DataTemplate>
                            <telerikInput:RadMaskedNumericInput x:Name="txtAmount" Mask="#11.2" 
                                                                SpinMode="None" IsClearButtonVisible="False" SelectionOnFocus="SelectAll"
                                                                KeyboardNavigation.TabNavigation="Local" TextMode="PlainText"                                                                
                                                                Validation.ErrorTemplate="{StaticResource TextBoxErrorTemplate}"  
                                                                 >
                                <telerikInput:RadMaskedNumericInput.Value>
                                    <Binding Path="Amount" Mode="TwoWay" UpdateSourceTrigger="LostFocus">
                                        <Binding.ValidationRules>
                                            <imKASHelper:DoubleValidationRule Min="-10000000000.00" Max="10000000000.00" />
                                        </Binding.ValidationRules>
                                    </Binding>
                                </telerikInput:RadMaskedNumericInput.Value>
                            </telerikInput:RadMaskedNumericInput>
  
                        </DataTemplate>
                    </telerik:GridViewDataColumn.CellEditTemplate>
                </telerik:GridViewDataColumn>
            </telerik:RadGridView.Columns>
            <telerik:RadGridView.GroupRowStyle>
                <Style TargetType="telerik:GridViewGroupRow">
                    <Setter Property="ShowHeaderAggregates" Value="False"></Setter>                    
                </Style>
            </telerik:RadGridView.GroupRowStyle>
  
            <telerik:RadGridView.GroupHeaderTemplate>                
                <DataTemplate>
                    <StackPanel Orientation="Horizontal" Margin="0,0" Height="45">
                        <TextBlock Text="{Binding Group.Key}" Margin="0,0,0,2" Width="200" />                        
                        <telerik:AggregateResultsList ItemsSource="{Binding AggregateResults}" VerticalAlignment="Center">
                            <ItemsControl.ItemTemplate>
                                <DataTemplate>
                                    <StackPanel Orientation="Vertical" VerticalAlignment="Center">
                                        <TextBlock VerticalAlignment="Center" HorizontalAlignment="Center" Text="{Binding Caption}" Width="90" />
                                        <TextBlock VerticalAlignment="Center" HorizontalAlignment="Center" Text="{Binding FormattedValue}" Width="90" Style="{StaticResource EnterpriseStatusStyle}" />
                                    </StackPanel>
                                </DataTemplate>
                            </ItemsControl.ItemTemplate>
                            <ItemsControl.ItemsPanel>
                                <ItemsPanelTemplate>
                                    <StackPanel Orientation="Horizontal" />
                                </ItemsPanelTemplate>
                            </ItemsControl.ItemsPanel>
                        </telerik:AggregateResultsList>
                    </StackPanel>
  
                </DataTemplate>
            </telerik:RadGridView.GroupHeaderTemplate>
            <telerik:RadGridView.GroupDescriptors>
                <telerik:GroupDescriptor x:Name="TransactionGroup" Member="TransactionGroup" SortDirection="Ascending" >
                    <telerik:GroupDescriptor.AggregateFunctions>
                        <telerik:MinFunction Caption="Cash" SourceField="CashTotal" ResultFormatString="{}{0:0.00}"  />
                        <telerik:MinFunction Caption="Beg Inv" SourceField="BegInvTotal" ResultFormatString="{}{0:0.00}"  />
                        <telerik:MinFunction Caption="End Inv" SourceField="EndInvTotal" ResultFormatString="{}{0:0.00}"  />
                        <telerik:MinFunction Caption="Beg Acc" SourceField="BegAccruedTotal" ResultFormatString="{}{0:0.00}"  />
                        <telerik:MinFunction Caption="End Acc" SourceField="EndAccruedTotal" ResultFormatString="{}{0:0.00}"  />
                        <telerik:MinFunction Caption="Accrual" SourceField="AccrualAmount" ResultFormatString="{}{0:c2}"  />
                        <telerik:SumFunction Caption="Ent Amt" SourceField="Amount" ResultFormatString="{}{0:c2}"  />
                        <local:EnterpriseDifferenceFunction Caption="Diff" ResultFormatString="{}{0:0.00}" />
                    </telerik:GroupDescriptor.AggregateFunctions>
                </telerik:GroupDescriptor>
            </telerik:RadGridView.GroupDescriptors>
        </telerik:RadGridView>

Stefan
Telerik team
 answered on 20 Feb 2015
3 answers
264 views
Hello. I want to implement future to draw shapes at runtime. In your docs are described, how to draw custom shapes or connections, but there are no info how to paint predefined shapes (Rectangles, Ellipses, Containers, etc.). This future is available only by drag and drop. But how  I can set draw (paint mode) dor mouse, like in MsPaint

http://joxi.ru/82Qqyg0spOaj2d
Pavel R. Pavlov
Telerik team
 answered on 20 Feb 2015
1 answer
107 views
I have some .xml files that are packages of some classes. I want to show those classes in telerik wpf diagrams control as a class diagram.
What is the best way of displaying class diagrams in WPF from .xml files? It should also populate diagrams automatically, that there is a minimum number of intersections in connections. 

Thanks,
Martin Ivanov
Telerik team
 answered on 20 Feb 2015
3 answers
93 views
Good morning,
i was just taking a deeper look at the two controls and it works realy well.
So I have two little questions:
- When i give my pdfviewer in xaml a documentsource, does it call my custom decode filter? Or i need to load/reload my pdf?
- What are the standard decode filters for pdfviewer? I mean if i have no custom filter implemented which decode filter is used?

Hope you can help me,

mfg David
David
Top achievements
Rank 1
 answered on 20 Feb 2015
11 answers
937 views

Hi,

 

I want to have a footer in one of my gridview columns that has two rows: one containing a textbox bound to a field in model view, and the second row displays the sum of items in that column.

 

---------------------------------

Total:  {text box}

                <sum>

---------------------------------

 

I have followed the suggestion from another thread to have a style for the footer to set the binding, and then reference that style on the column. 

 

<Style x:Key="SalesTotalStyle" TargetType="telerik:GridViewFooterCell">
    <Setter Property="ContentTemplate">
        <Setter.Value>
            <DataTemplate>
                <Grid>
                    <Grid.RowDefinitions>
                        <RowDefinition />
                        <RowDefinition />
                    </Grid.RowDefinitions>
                    <TextBlock Grid.Row="0" Width="75" TextAlignment="Right" FontWeight="Bold"  Text="{Binding Path=DataContext.SalesSum,
                               RelativeSource={RelativeSource AncestorType=telerik:GridView}}" />
                    <TextBox Grid.Row="1" Text="{Binding Path=DataContext.ExpetedSalesTotal,                               
                       RelativeSource={RelativeSource AncestorType=telerik:GridView}}" Width="75" TextAlignment="Right"/>
                </Grid>
            </DataTemplate>
        </Setter.Value>
    </Setter>
</Style>


This works great and it does display y the data properly in the textbox.  However, how  can I add an aggregate function in the style section?? 
I undetstand aggregate functions will not show if the footer is set.  I have also tried to create a sum property (SalesSum) that reruns the sum of underlying data, whoever it doesn’t get refreshed in the grid as the user enters items in the column.  Any suggestion?

 



Cheers
Eliot
Top achievements
Rank 1
 answered on 20 Feb 2015
7 answers
151 views
Hello Telerik,

is the a way to use a QueryableEntityCollectionView object (bounded to a RadGridView) with EF6 which has a DBContext instate of ObjectContext?
I'm chaining my Telerik application form EF 4 to EF 6.
Or can you give me a link to a simple GridView example using Entity Framework 6?

Regards Uwe
Maya
Telerik team
 answered on 20 Feb 2015
2 answers
111 views
Hello,

for some reason, the manipulation adorner is offset relative to the shape after selecting a rotated shape (see attached image).
When selecting a shape with rotation angle = 0 and while rotating it, the adorner stays at the expected position.

What could be the cause for this behavior?

Alex
Alexander
Top achievements
Rank 1
 answered on 19 Feb 2015
1 answer
87 views
I have a spreadsheet control with data and the headers frozen by code.

Then any filter is applied on any column, that works. But when the filter is cleared by
the option “Clear Filter” some rows are frozen in addition to the previous
frozen header. In some cases, after clearing the filter, all the visible rows
are frozen and scroll does not move anything…

Any help?
Anna
Telerik team
 answered on 19 Feb 2015
Narrow your results
Selected tags
Tags
+? more
Top users last month
Rob
Top achievements
Rank 3
Iron
Iron
Iron
Atul
Top achievements
Rank 1
Iron
Iron
Iron
Alexander
Top achievements
Rank 1
Veteran
Iron
Serkan
Top achievements
Rank 1
Iron
Shawn
Top achievements
Rank 1
Iron
Iron
Want to show your ninja superpower to fellow developers?
Top users last month
Rob
Top achievements
Rank 3
Iron
Iron
Iron
Atul
Top achievements
Rank 1
Iron
Iron
Iron
Alexander
Top achievements
Rank 1
Veteran
Iron
Serkan
Top achievements
Rank 1
Iron
Shawn
Top achievements
Rank 1
Iron
Iron
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?