locked
Problem in Apply Styles to Datepicker RRS feed

  • Question

  • I have prepared a app that i have custom styles applied.

    Here i dont knw why the default style of the Toolkit Datepicker control is like this .

    http://img829.imageshack.us/img829/8882/67261065.jpg

    somethin like that in the image above.

     

    Tuesday, August 31, 2010 8:14 AM

Answers

  • Hi Amit_thakkar,

    This is because your typed styles will also affect the controls that consists a DatePicker.

    There seems to be a typed style for Button in your custom styles, and you defined a MinWidth for buttons. The icon on the right of a DatePicker is actually a button so this MinWidth is also applied.

    You can solve this issue by define a defualt button style for DatePicker.

    Please add the following style to your custom styles. It should work.

        <Style TargetType="{x:Type DatePicker}">
          <Style.Resources>
            <Style TargetType="Button"/>
          </Style.Resources>
        </Style>
    

    If it doesn't work, please add your custom styles one by one to find out which causes this issue. Then you can add the default style for the corresponding type to the above code.

    If you still have any doubts or concerns about this issue, please feel free to let me know.

    Best regards,

    Min


    Please remember to click “Mark as Answer” on the post that helps you, and to click “Unmark as Answer” if a marked post does not actually answer your question. This can be beneficial to other community members reading the thread.
    • Marked as answer by Amit_thakkar Monday, September 6, 2010 5:55 AM
    Friday, September 3, 2010 7:31 AM