Home Forums WPF controls Xceed DataGrid for WPF DatePicker theme

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

    Thank you for the previous answer.
    I have another:
    🙂

    VS2008:
    I drag your DatePicker from the ToolBox to the Window as a separate Control.
    It appears in the XAML file as:

    <xcdg:DatePicker Height=”15.96″ HorizontalAlignment=”Right” Margin=”0,19,5,0″ Name=”datePicker1″ VerticalAlignment=”Top” Width=”88.36″ />

    That’s right.
    However, could I change the Theme of the DatePicker?

    similarly as I set the Theme of the Datagrid for example:

    m_ItemsDataGrid.View.Theme = new Xceed.Wpf.DataGrid.Views.ClassicSystemColorTheme();

    But, I would like to change the style of the DatePicker as a separate control this time.

    Is it possible?

    Imported from legacy forums. Posted by agy666 (had 5304 views)

    User (Old forums)
    Member
    Post count: 23064

    Since nobody replies this, I start to believe that it is not possible to change the theme/style of the separate DatePicker.
    🙁

    Imported from legacy forums. Posted by agy666 (had 1037 views)

    User (Old forums)
    Member
    Post count: 23064

    I also require this. Any update?

    Imported from legacy forums. Posted by MattCheshire (had 807 views)

    Xceed Support
    Member
    Post count: 5658

    It is not possible to style the DatePicker in the same way as the grid as there is no notion “theme”. That said, you can template and style the DatePicker like any other WPF control.

    Maybe you could take a look at the theme files included with the grid (in the “Common” folder under the installation directory) and copy the templates and styles that are used from there.

    I will add a request for this feature.

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

    User (Old forums)
    Member
    Post count: 23064

    Hi, i tried creating a style for the datepicker, but as soon as the style is created i get a “cant set the mask” error. So i remove the mask attribute from the style, from there the control just stops working.

     

    Could you post the datepicker’s style or point me to the right direction for editing?

     

    Thanks,

    Andres.

    Imported from legacy forums. Posted by Andres (had 670 views)

    User (Old forums)
    Member
    Post count: 23064

    [quote user=”Andres”]

    Hi, i tried creating a style for the datepicker, but as soon as the style is created i get a “cant set the mask” error. So i remove the mask attribute from the style, from there the control just stops working.

     

    Could you post the datepicker’s style or point me to the right direction for editing?

     

    Thanks,

    Andres.

    [/quote]

    My experience exactly.

    When I use blend to create a template for the control it defaults a lot of values. These values should be data bound but blend does not seem to know this.

    I did a text search for “DataTime” on the folder “c:\Program Files\Xceed\Xceed DataGrid for WPF v2.0\Themes\” and did not find any files that contain that text string…

    Can you please please post an “empty” template? I don’t need one of your really beautiful ones, just a blank one where I can replace SystemColor.* with my own color set.

    Thank you very much.

    Imported from legacy forums. Posted by Du Toit (had 653 views)

    User (Old forums)
    Member
    Post count: 23064

    This is a recurring question on the forums so we are indeed considering adding a way to style your own datePicker. Currently you need to have access to our source code (by buying the blue print edition) to modify the look and feel of the control. At the time being, I cannot post an empty template of the control until some work has been done to allow “public” modifications.

    Imported from legacy forums. Posted by Matt (had 757 views)

    User (Old forums)
    Member
    Post count: 23064

    Could it be possible as a step one be to link all the brushes and colors to a dynamic resource defined in an external file.

    So instead of linking to SystemColors.* you link to “XceedDatePicker_*” and the users can then define the colors.

    I do not want to change the way the date picker control behaves, I just want it to change the background, border and text colors.

    Thank you [;)]

    Imported from legacy forums. Posted by Du Toit (had 671 views)

    User (Old forums)
    Member
    Post count: 23064

    A custom DatePicker style example has been published:

    http://xceed.com/CS/files/folders/jenny/entry15224.aspx

    Imported from legacy forums. Posted by Michel (had 940 views)

    User (Old forums)
    Member
    Post count: 23064

    After a day of tryes and working with Reflector I found the way.

    DataGrid themes stores in separated assemblies Xceed.Wpf.DataGrid.ThemePack.1(2)(3).

    Using Reflector’s addin “BAML Viever” you can access to the compilled XAML(BAML) files where stores controls styles.

    Now you know the name of resource file and key of needed resource.

    Now for example if you want to set Glass style to DatePicker you can use following code.

    System.Reflection.

    Assembly assembly = System.Reflection.Assembly.LoadFrom(“Xceed.Wpf.DataGrid.ThemePack.2.dll”);

    string packUri = @”/Xceed.Wpf.DataGrid.ThemePack.2;component/themes/glass/resources/glass.controls.xaml”;

    ResourceDictionary rd = Application.LoadComponent(new Uri(packUri, UriKind.Relative)) as ResourceDictionary;

    DatePicker dpTest = new DatePicker();

    dpTest.Style = rd[typeof(Xceed.Wpf.Controls.DatePicker)] as Style;

    Imported from legacy forums. Posted by andrey (had 1049 views)

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