Telerik Forums
UI for WPF Forum
5 answers
501 views
Hi Telerik,

I'm having trouble getting the calendar to reselect template for the calendarbuttoncontent after initial load.

I've found that if I "browse" the calendar (so that the content is not shown) and back again, the template is reapplied, using updated information in my behind lists of dates.

I have created the following template selector:

public class CalendarButtonTemplateSelector : DataTemplateSelector
{
    public override DataTemplate SelectTemplate(object item, DependencyObject container)
    {
        CalendarButtonContent content = item as CalendarButtonContent;
        if (content != null && content.ButtonType == CalendarButtonType.Date)
        {
            if (CentralCalendarWindow.CalendarViewItems != null && CentralCalendarWindow.CalendarViewItems.Exists(c => c.Date == content.Date))
            {
                CalendarViewItem calendarViewItem = CentralCalendarWindow.CalendarViewItems.Find(c => c.Date == content.Date);
                if (calendarViewItem.Holiday)
                {
                    return HolidayTemplate;
                }
                else if (calendarViewItem.NoDistribution)
                {
                    return NoDistributionTemplate;
                }
                else if (calendarViewItem.PartlyNoDistribution)
                {
                    return PartlyNoDistributionTemplate;           
                }
            }
        }
        return DefaultTemplate;
    }
    public DataTemplate DefaultTemplate { get; set; }
    public DataTemplate HolidayTemplate { get; set; }
    public DataTemplate NoDistributionTemplate { get; set; }
    public DataTemplate PartlyNoDistributionTemplate { get; set; }
}

In XAML i bind to the selector as a static resource like this:

DayTemplateSelector="{StaticResource templateSelector}"

And my template selection is like this:

<this:CalendarButtonTemplateSelector x:Key="templateSelector"
      DefaultTemplate="{StaticResource dataTemplateDefault}"
      HolidayTemplate="{StaticResource dataTemplateHoliday}"
      NoDistributionTemplate="{StaticResource dataTemplateNoDistribution}"
      PartlyNoDistributionTemplate="{StaticResource dataTemplatePartlyNoDistribution}"/>


Now the question - How can I explicitly have the calendar redo its template selection, like it does when the content gets redrawn when "browsing" the calendar.

And what I would really want to do is to only redo the template selection on specific days if possible.

Thanks in advance!
Best regards,
Kasper Schou
Konstantina
Telerik team
 answered on 31 Oct 2012
3 answers
198 views
Hi,

I 'm actually designing a new WPF application based on RadControls Q2 2012 with VS2012 RC / windows 7.
I would like to customize RadGridView styles. I imagine that using Blend would simplify the task.
The problem is that Blend 5 does not support wpf nor silverlight projects on windows 7:
See this link http://social.expression.microsoft.com/Forums/en-US/blend/thread/8cdd9710-8aa0-4fea-aef8-ce2709a8f5d8

How could I easily customize the RadControls Q2 2012 styles?
Thank's for your help.
JC
Jc
Top achievements
Rank 1
 answered on 31 Oct 2012
0 answers
64 views
Hi,
i need binding string value to PropertyDefinition in code:
no binding from obj or class, set value for show for this property.
In My Project i have diffrent property for diffrent Class and i have many diffrent class that creating from database in runtime.
i want add property and value behinde code and not with binding , i want fill propertygrid manually.
the other word i want read property name and value from database and show in propertyGrid
If can get me sample code ,

Please helpe me. 
 Thanks
Pv
Top achievements
Rank 1
 asked on 31 Oct 2012
0 answers
90 views
Hi Staff, 
    how to handle the event when a user delete a part of a text or a InlineUIContainer element?

Thank you in advice.

A.
Alberto
Top achievements
Rank 1
 asked on 31 Oct 2012
0 answers
89 views
hi,
i've integrated dynamic language switching into my project. I use the radgridview with the filtering options. I've noticed the filter does not have the required language resources for italian (although there is an italian language pack). it works fine with english/german/french/spanish so i'm just guessing the translation has been forgotten, or something went wrong with the dll.

i am using 2012.3.1017 wpf40
marc
Top achievements
Rank 1
 asked on 31 Oct 2012
1 answer
84 views
Hi Telerik

Is there any way of creating the chart as per attached image. We want to colour the difference between two line charts.

Rav
Petar Marchev
Telerik team
 answered on 31 Oct 2012
0 answers
86 views
Hi staff, 
   how to define a tooltip of a single button of RadRichTextBoxStatusBar control ?

Thank you

A.
Alberto
Top achievements
Rank 1
 asked on 31 Oct 2012
13 answers
348 views
Hi,
I want to learn how can i create page animation for a wpf applicattion like your RadControls for WPF Demos Application. As you know, it has left TreeView Menu with icons, and when you click a TreeView item, pages are sliding to left, and dissappearing.
Huas
Top achievements
Rank 1
 answered on 30 Oct 2012
7 answers
280 views
I was using the RadMaskedTextbox, but when moving from silverlight to WPF, I would get a red border around the RadMaskedTextbox for my currency.  These RadMaskedTextboxs were in a tabcontrol, and the red border would go away if I went to another tab and came back.  Since RadMaskedTextbox is being replaced, I thought I'd use RadMaskedCurrencyInput, but I ran into a few problems.

1. When I try to clear it, I'll get an error "Value '' could not be converted" - I'm guessing this is because I'm binding a decimal and not a double.  When you're dealing with currency, C# tells you to ALWAYS use decimal.  I guess I could add a converter to my binding, but I'd rather there be a better way.

2.  Those leading placeholders.  Even if I turn off autofillnumbergroupserpartors, I won't get the comas after I lose focus.

3. When I type focus on a RadMaskedCurrencyInput and type "123",   "321.00" shows up in the textbox

I'm leaning towards using a  RadMaskedTextInput and only allowing 1-9 and '.''s.  I guess it would be nice if I could keep using RadMaskedTextbox, but I can't expect you to fix an issue on a control that's outdated?  Is there a way to get rid of those red borders in a tabcontrol?  It works fine in Silverlight, but not WPF.  I could probably create a sample project for you, but I don't want to waste time because that control is outdated.




danparker276
Top achievements
Rank 2
 answered on 30 Oct 2012
2 answers
149 views
I updated to the latest WPF Rad controls this morning and it seems to have broken a view things.

I have a RichTextBox and some of the controls above it, like bold, italic, underline, etc. etc.  However after updating, all the alignment toggle buttons no longer work, they don't center, left, or right align the text in the document. I redownloaded the demos to see how it worked in there, and most of the code looks the same, except for in the code behind things like 

document.PageViewMargin = new SizeF(10, 10);

PageViewMargin isn't an option.
Vasil
Telerik team
 answered on 30 Oct 2012
Narrow your results
Selected tags
Tags
+? more
Top users last month
Jay
Top achievements
Rank 3
Iron
Iron
Iron
Benjamin
Top achievements
Rank 3
Bronze
Iron
Veteran
Radek
Top achievements
Rank 2
Iron
Iron
Iron
Bohdan
Top achievements
Rank 2
Iron
Iron
Richard
Top achievements
Rank 4
Bronze
Bronze
Iron
Want to show your ninja superpower to fellow developers?
Top users last month
Jay
Top achievements
Rank 3
Iron
Iron
Iron
Benjamin
Top achievements
Rank 3
Bronze
Iron
Veteran
Radek
Top achievements
Rank 2
Iron
Iron
Iron
Bohdan
Top achievements
Rank 2
Iron
Iron
Richard
Top achievements
Rank 4
Bronze
Bronze
Iron
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?