Telerik Forums
UI for WPF Forum
1 answer
102 views
Hi,

I would like to see an example on how to use EF entities as a model with validation being based on EF partial class data annotations.

Thanks in advance
Pavel Pavlov
Telerik team
 answered on 22 Sep 2011
17 answers
371 views
I have downloaded the beta q2 2010 wpf controls and i can't see the busy indicator control in my toolbox from within visual studio 2010 wpf web application. Please can you help.

Thanks
Boyan
Telerik team
 answered on 22 Sep 2011
3 answers
508 views
Hi,

I can't find any example of RadComboBox validation.
Would you be so kind to show an example of simple validation ?

Thx,
Julian
Konstantina
Telerik team
 answered on 22 Sep 2011
1 answer
39 views
Hello.

Since my upgrade from Q1 to Q2 i have a problem with the radtabcontrol.

When my window loads, it no longer shows a tabitem unless i click on the tab itself.
I tried setting the SelectedIndex, SelectedItem, IsSelected = True, everything, i cant achieve to show the tabitems.

HUGE EDIT: It also seems that my dropdowns are getting 'stucked', cant select my items any longer

Any help for this annoying little problem?

Greetings!
Petar Mladenov
Telerik team
 answered on 22 Sep 2011
1 answer
127 views
Hi,

I have a problem with the status of BeginEdit.
My scenario:
When I start my application I fill the ScheduleView-Control with appointments (the Control is part of the startwindow).
In the Main.Loaded eventhandler I define a Eventhandler which is fired when the ScheduleViewControl is loaded.

Private Sub Event_Main_Loaded(ByVal sender As Object, ByVal e As System.Windows.RoutedEventArgs) Handles Me.Loaded
            AddHandler Me.radSchedBZP.Loaded, AddressOf Event_radSchedBZP_Loaded
End Sub

Inside the EventHandler Event_radSchedBZP_Loaded I fill the Control with appointments.
The Return-Value of BeginEdit is always "False". What can i do?
Dim app As Telerik.Windows.Controls.ScheduleView.Appointment = Me.radSchedBZP.CreateNew()
Dim bolIsLoaded As Boolean = Me.radSchedBZP.IsLoaded    => is true
                If Me.radSchedBZP.BeginEdit(app) Then
                    With app
                        .Subject = ...
                        .Body = ...
                         ...
                         ...
                        Me.radSchedBZP.Commit()
              endif

Thanks in advance.
kindly regards,
Stefan
 
Rosi
Telerik team
 answered on 22 Sep 2011
2 answers
636 views
Hi,
Is there away to  remove the maximize and minimize buttons from the Rad Window. I would like to this dynamically in code.
Notes note = new Notes();
int NoteID = note.AddNote(_wardcode);
 
 Telerik.Windows.Controls.RadWindow rw = new Telerik.Windows.Controls.RadWindow();
 rw.Width = nw / 5;
 rw.Height = nh / 4;
 rw.Name = "NotePad" + NoteID;
 rw.BorderThickness = new Thickness(0);
 rw.BorderBrush = null;
 rw.Header = "Note" + DateTime.Now.ToShortDateString();
 
 Grid grid = new Grid();
 
 grid.Background = new SolidColorBrush(System.Windows.Media.Color.FromArgb(255, 240, 255, 255));
  
 System.Windows.Controls.RichTextBox rtxtbx = new System.Windows.Controls.RichTextBox();
 rtxtbx.Name = "txtNotePad" + NoteID;
 rtxtbx.FontSize = fontsize * 2;
 rtxtbx.GotFocus += new RoutedEventHandler(rtxtbx_GotFocus);
 rtxtbx.LostFocus += delegate(object sender, RoutedEventArgs e) { rtxtbx_LostFocus(sender, e, NoteID); };
 
 rw.LayoutChangeEnded += delegate(object sender, EventArgs e) { Page2_LayoutChangeEnded(sender, e, NoteID); };
 rw.Closed += delegate(object sender, WindowClosedEventArgs e) { Page2_Closed(sender, e, NoteID); };
 rw.LostFocus += new RoutedEventHandler(rw_LostFocus);
  
 grid.Children.Add(rtxtbx);
 rw.Content = grid;
 rw.Show();

Any help would be great

Thanks

Simon
N Mackay
Top achievements
Rank 1
 answered on 22 Sep 2011
4 answers
170 views
I got a trouble about if I re-Template the CalendarButton, then the RadCalendar doesn't work with DayTemplateSelector. 

It doesnot work if I set the DayButtonStyle which inside the style I retemplate the Calendarbutton.
<telerik:RadCalendar DayButtonStyle="{StaticResource CalendarButtonStyle}" >
               <telerik:RadCalendar.Style>
                   <Style TargetType="{x:Type telerik:RadCalendar}">
                       <Setter Property="DayTemplate" Value="{x:Null}"/>
                       <Setter Property="DayTemplateSelector" >
                           <Setter.Value>
                               <local:CustomTemplateSelector/>
                           </Setter.Value>
                       </Setter>
                   </Style>
               </telerik:RadCalendar.Style>
</telerik:RadCalendar>

It will work with selector only if I delete the retemplate part in the CalendarButtonStyle.

How can I use the selector as well as retemplate the CalendarButton.

Hoping for your help. Thanks.


YiChen
Top achievements
Rank 1
 answered on 22 Sep 2011
2 answers
239 views
Hi,
I have a question for RadDropDownButton and Modal window in XBAP model. If you click the dropdown item of RadDropDownButton, it will popup the modal window (ShowDialog), but the DropDownContent doesn't disappear and it is on top of the ModalBackground. If you click the other place, the DropDownContent disappears. I want to know how can i resolve it?

<Page x:Class="WpfBrowserApplication1.Page1"
      mc:Ignorable="d"
      d:DesignHeight="600" d:DesignWidth="800"
      Title="Page1">
    <Grid VerticalAlignment="Top">
        <StackPanel Orientation="Horizontal" >
            <telerik:RadDropDownButton Focusable="False" x:Name="RadDropDownButton1" Width="120" Height="120" Background="{x:Null}" Margin="20" CornerRadius="8" BorderThickness="1" BorderBrush="#E0E0E0"  DropDownButtonPosition="Bottom" DropDownIndicatorVisibility="{Binding IsShowContent}">
                <StackPanel Orientation="Vertical" Margin="0,0,0,0">
                    <Image Width="84" Height="84" Source="/WpfBrowserApplication1;component/Images/soundforge.ico" />
                    <TextBlock HorizontalAlignment="Center" FontWeight="Bold"  VerticalAlignment="Center" Text="soundforge" />
                </StackPanel>
                <telerik:RadDropDownButton.DropDownContent>
                    <ListBox BorderThickness="0" Focusable="False">
                        <telerik:RadMenuItem Focusable="False" Height="32" Width="230" Header="Header1" Click="RadMenuItem_Click">
                            <telerik:RadMenuItem.Icon>
                                <Image Height="16" Width="16" Source="/WpfBrowserApplication1;component/Images/Bmp.ico" />
                            </telerik:RadMenuItem.Icon>
                        </telerik:RadMenuItem>
                    </ListBox>
                </telerik:RadDropDownButton.DropDownContent>
            </telerik:RadDropDownButton>
        </StackPanel>
    </Grid>
</Page>
private void RadMenuItem_Click(object sender, RoutedEventArgs e)
 {
            RadControlsScenario1 dd = new RadControlsScenario1();
            dd.WindowStartupLocation = WindowStartupLocation.CenterScreen;
            dd.ShowDialog();
            dd.Focus();
 }


Thanks,
Ted.
Ted
Top achievements
Rank 1
 answered on 22 Sep 2011
1 answer
463 views

Occasionally, our application crashes shortly after the following exception is record in the log:

08/25/2011 16:00:56.140 FATAL System.ArgumentException: An item with the same key has already been added.

I will include the full stack trace below.

It seems to happen after new items are added to the observable collection that is data bound to the grid, or after properties of items in the grid change, or after a user sorts or groups the grid. I suspect (but am not sure) that the problem is that our entities displayed in the grid have an incorrect overloaded GetHashCode method - the return value of the GetHashCode method may change for a given entity while it is in the collection. We intend to fix this, but the grid should not crash when encountering this situation.

My question is, how can I trap for this type of exception in the RadGridView? I am using MVVM, and the RadGridView is declared in XAML. 

Using version 2010.3.1314.35

Thanks
Chris

08/25/2011 16:00:56.140 FATAL System.ArgumentException: An item with the same key has already been added.
   at System.ThrowHelper.ThrowArgumentException(ExceptionResource resource)
   at System.Collections.Generic.Dictionary`2.Insert(TKey key, TValue value, Boolean add)
   at System.Collections.Generic.Dictionary`2..ctor(IDictionary`2 dictionary, IEqualityComparer`1 comparer)
   at Telerik.Windows.Data.Selection.InternalSelectionItemsStorage..ctor(InternalSelectionItemsStorage itemsStorage) in c:\Builds\WPF_Scrum\Release_WPF\Sources\Development\Core\Data\Selection\InternalSelectionItemsStorage.cs:line 16
   at Telerik.Windows.Data.Selection.ItemSelectionHandler.BeginSelection() in c:\Builds\WPF_Scrum\Release_WPF\Sources\Development\Core\Data\Selection\ItemSelectionHandler.cs:line 571
   at Telerik.Windows.Controls.DataControl.PersistIsCurrentPropertry(RadRowItem container, Object dataItem) in c:\Builds\WPF_Scrum\Release_WPF\Sources\Development\Core\Data\DataControl.Selection.cs:line 426
   at Telerik.Windows.Controls.GridView.GridViewDataControl.PrepareContainerForItemOverride(DependencyObject element, Object item) in c:\Builds\WPF_Scrum\Release_WPF\Sources\Development\Controls\GridView\GridView\GridView\GridViewDataControl.cs:line 7573
   at Telerik.Windows.Controls.GridView.BaseItemsControl.Telerik.Windows.Controls.GridView.IGeneratorHost.PrepareItemContainer(DependencyObject container, Object item) in c:\Builds\WPF_Scrum\Release_WPF\Sources\Development\Controls\GridView\GridView\GridView\ItemsControl\BaseItemsControl.cs:line 336
   at Telerik.Windows.Controls.GridView.GridViewItemContainerGenerator.System.Windows.Controls.Primitives.IItemContainerGenerator.PrepareItemContainer(DependencyObject container) in c:\Builds\WPF_Scrum\Release_WPF\Sources\Development\Controls\GridView\GridView\GridView\ItemsControl\GridViewItemContainerGenerator.cs:line 260
   at Telerik.Windows.Controls.GridView.GridViewVirtualizingPanel.InsertContainer(Int32 childIndex, UIElement container, Boolean isRecycled) in c:\Builds\WPF_Scrum\Release_WPF\Sources\Development\Controls\GridView\GridView\GridView\Virtualization\GridViewVirtualizingPanel.cs:line 2067
   at Telerik.Windows.Controls.GridView.GridViewVirtualizingPanel.AddContainerFromGenerator(Int32 childIndex, UIElement child, Boolean newlyRealized) in c:\Builds\WPF_Scrum\Release_WPF\Sources\Development\Controls\GridView\GridView\GridView\Virtualization\GridViewVirtualizingPanel.cs:line 2114
   at Telerik.Windows.Controls.GridView.GridViewVirtualizingPanel.MeasureOverride(Size constraint) in c:\Builds\WPF_Scrum\Release_WPF\Sources\Development\Controls\GridView\GridView\GridView\Virtualization\GridViewVirtualizingPanel.cs:line 1215
   at System.Windows.FrameworkElement.MeasureCore(Size availableSize)
   at System.Windows.UIElement.Measure(Size availableSize)
   at MS.Internal.Helper.MeasureElementWithSingleChild(UIElement element, Size constraint)
   at System.Windows.Controls.ScrollContentPresenter.MeasureOverride(Size constraint)
   at System.Windows.FrameworkElement.MeasureCore(Size availableSize)
   at System.Windows.UIElement.Measure(Size availableSize)
   at System.Windows.Controls.Grid.MeasureCell(Int32 cell, Boolean forceInfinityV)
   at System.Windows.Controls.Grid.MeasureCellsGroup(Int32 cellsHead, Size referenceSize, Boolean ignoreDesiredSizeU, Boolean forceInfinityV)
   at System.Windows.Controls.Grid.MeasureOverride(Size constraint)
   at System.Windows.FrameworkElement.MeasureCore(Size availableSize)
   at System.Windows.UIElement.Measure(Size availableSize)
   at System.Windows.Controls.ScrollViewer.MeasureOverride(Size constraint)
   at System.Windows.FrameworkElement.MeasureCore(Size availableSize)
   at System.Windows.UIElement.Measure(Size availableSize)
   at System.Windows.ContextLayoutManager.UpdateLayout()
   at System.Windows.ContextLayoutManager.UpdateLayoutCallback(Object arg)
   at System.Windows.Media.MediaContext.InvokeOnRenderCallback.DoWork()
   at System.Windows.Media.MediaContext.FireInvokeOnRenderCallbacks()
   at System.Windows.Media.MediaContext.RenderMessageHandlerCore(Object resizedCompositionTarget)
   at System.Windows.Media.MediaContext.RenderMessageHandler(Object resizedCompositionTarget)
   at System.Windows.Threading.ExceptionWrapper.InternalRealCall(Delegate callback, Object args, Boolean isSingleParameter)
   at System.Windows.Threading.ExceptionWrapper.TryCatchWhen(Object source, Delegate callback, Object args, Boolean isSingleParameter, Delegate catchHandler)
Vlad
Telerik team
 answered on 22 Sep 2011
2 answers
280 views
I am using a GridViewCheckBoxColumn. My requirement is i will hide the checkbox in each row if binded value lavel is 6. I had used one Cell Style Selector. If i make the visibility=Collapsed then the cell as well as cell border is also not displayed and looking odd. Please help me how i will be able to collapse few cells based on above condition with the only checkbox collapsed and border remain as it is


public

 

class CustomVisibilityStyle : StyleSelector

 

{

 

public override Style SelectStyle(object item, DependencyObject container)

 

{

 

PeopleDataDC ppl = item as PeopleDataDC;

 

 

if (ppl.Level == 6)

 

{

 

return VisibleStyle;

 

}

 

else

 

{

//((System.Windows.Controls.

ContentPresenter)(((System.Windows.Controls.Grid)(((Telerik.Windows.Controls.GridView.GridViewCell)(container)).Template.LoadContent())).Children[7])).Visibility = Visibility.Collapsed;

 

 


return
CollapsedStyle;

 

}

 

return CollapsedStyle;

 

}

 

public Style VisibleStyle { get; set; }

 

 

public Style CollapsedStyle { get; set; }

 

}

Marc
Top achievements
Rank 1
 answered on 21 Sep 2011
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?