Home Forums WPF controls Xceed DataGrid for WPF Using and declaring StatFunctions only in code behind

Viewing 12 posts - 1 through 12 (of 12 total)
  • Author
    Posts
  • User (Old forums)
    Member
    Post count: 23064
    #24906 |

    Hi,

    It´s possible to use statfunctions and grouping only coding in C#.
    I want to only use this XAML code :

    <UserControl x:Class=”GMS_APP.DaylyInfo”
    xmlns=”http://schemas.microsoft.com/winfx/2006/xaml/presentation&#8221;
    xmlns:xcdg=”http://schemas.xceed.com/wpf/xaml/datagrid&#8221;
    xmlns:x=”http://schemas.microsoft.com/winfx/2006/xaml&#8221;
    xmlns:my=”clr-namespace:System;assembly=mscorlib”
    Height=”364.276666666667″ Width=”756.976666666667″>
    <Grid>
    <xcdg:DataGridControl Name=”DataGrid”
    NavigationBehavior=”RowOrCell”
    Margin=”0,0,1,0″
    ItemsSource=”{x:Null}”>
    <xcdg:DataGridControl.View>
    <xcdg:TableView>
    <xcdg:TableView.Theme>
    <xcdg:AeroNormalColorTheme/>
    </xcdg:TableView.Theme>
    </xcdg:TableView>
    </xcdg:DataGridControl.View>
    </xcdg:DataGridControl>
    </Grid>
    </UserControl>

    And the binding , grouping and statfunction want to declare it in C# code behind.
    It´s possible, and if YES , where can i find example, because the source examples work with Xaml.

    thank you very much for your response.

    Imported from legacy forums. Posted by daniel (had 680 views)

    Xceed Support
    Member
    Post count: 5658

    You can create an instance of the DataGridCollectionview class and set its GroupDescriptions, SortDescriptions, and StatFunctions properties. The DataGridCollectionView can then be assigned to the grid’s ItemsSource property.

    Imported from legacy forums. Posted by Jenny [Xceed] (had 284 views)

    User (Old forums)
    Member
    Post count: 23064

    Thanks Jenny,

    there is some differences to proceed like that, wath are the pro´s cons of this method ?

    Imported from legacy forums. Posted by daniel (had 458 views)

    Xceed Support
    Member
    Post count: 5658

    Differences in regards to XAML vs. code?

    Imported from legacy forums. Posted by Jenny [Xceed] (had 276 views)

    User (Old forums)
    Member
    Post count: 23064

    Yes, I want to know the differences in coding all in C# or using XAML ?

    maybe the performance are comprometed !

    Imported from legacy forums. Posted by daniel (had 374 views)

    Xceed Support
    Member
    Post count: 5658

    Not sure and to be honest, I never really thought about it! XAML is the “preferred” WPF way so I usually suggest that clients use it although I do not think that using code causes any performance issues and vice-versa.

    On the other hand, you might encounter issues later on if using code-behind since some classes, such as FrameworkElementFactory, have been deprecated.

    Sorry that I can’t be of much help in this case 🙁

    Imported from legacy forums. Posted by Jenny [Xceed] (had 214 views)

    User (Old forums)
    Member
    Post count: 23064

    I don´t understant ? why deprecate ?

    If i want to use Zaml , i have the problem that i need to build a dataGrid for each use case i have.
    I now i want to build a parametrize datagrid to use with all my use case.

    Maybee i am taking the problem badly !

    Imported from legacy forums. Posted by daniel (had 365 views)

    User (Old forums)
    Member
    Post count: 23064

    I write this line in my code :

    _dataGridCollectionView.StatFunctions.Add(new SumFunction(ResultPropertyNameStr, SourcePropertyNameStr));

    and i have a licensing exception.
    It´s possible to use SumFunction in XAML :

    <xcdg:DataGridCollectionViewSource.StatFunctions>

    <xcdg:SumFunction ResultPropertyName=”unitprice_sum” SourcePropertyName=”UnitPrice”/>
    </xcdg:DataGridCollectionViewSource.StatFunctions>

    How can i do ?
    thanks for your ersponse, and excuse me if the question was asked before.

    Imported from legacy forums. Posted by daniel (had 445 views)

    User (Old forums)
    Member
    Post count: 23064

    The StatFunction alow with licence

    is allow in XAML without this licence ? The use of this classes are not allow in code with the basic licence ? is that true ?

    Thanks for your response.

    Best regards

    Imported from legacy forums. Posted by daniel (had 460 views)

    Xceed Support
    Member
    Post count: 5658

    What i meant is that creating DataTemplates is code is not suggested since the class that is used to create them (FrameworkElementFactory) has been flagged as obsolete (by MS) and will eventually be removed from the framework.

    That said, the statistical functions are available only to Vanguard subscribers. Unless you have a registered Vanguard license or a non-expired trial license key, you will not be able to use the statistical functions.

    Imported from legacy forums. Posted by Jenny [Xceed] (had 233 views)

    User (Old forums)
    Member
    Post count: 23064

    Ok, Thanks to your explanation.

    Only one more question :

    How can i add in Fixed Footers, a sumary row, where i been able to calculate average or others custom calcuation.
    It´s possible without Vanguard subscription.

    My Company are planning to suscribe a vanguard, but i don´t have green light now.

    Thanks for your help.

    PS : I can run the example “StatFunctions” ! is because i have a non-expired trial licence key in the code example.

    Imported from legacy forums. Posted by daniel (had 523 views)

    Xceed Support
    Member
    Post count: 5658

    If you have a non-expired trial, just remove the LicenseKey setting and you should be fine to test the StatFunctions (contact support if this is not the case).

    Take a look at either the Statistical Functions or Headers and Footers topics in the documentation. They demonstrate how to add elements to the headers and footers of a grid and group.

    Imported from legacy forums. Posted by Jenny [Xceed] (had 7568 views)

Viewing 12 posts - 1 through 12 (of 12 total)
  • You must be logged in to reply to this topic.