Telerik Forums
UI for WPF Forum
1 answer
139 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
707 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
179 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
258 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
490 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
308 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
2 answers
155 views
Hi,

i have a radtreeview filled with hierarchicaldata. In code i do the settings.

            _radTreeView = projectTreeView._xTreeView;
            _radTreeView.AllowDrop = true;

            _radTreeView.Drop += TreeViewDrop;
            _radTreeView.PreviewDrop += TreeViewPreviewDrop;
            _radTreeView.DragOver += ....


If i drop an item the dropevent doesnt fire. Temporarily i solved this and work with the previewdropevent. But i dont like this solution. Have anyone ideas where my problem is? Some points that i must check?

Thanks
Annett
Annett
Top achievements
Rank 1
 answered on 21 Sep 2011
1 answer
167 views
hi..
Please tell me how to binding ImageSource as DataMemberBinding of GridViewImageColumn. 

i am try this.But it`s not working.

public ImageSource  myimage { get;set;}

<telerik:GridViewImageColumn x:Name="InsatllmentCustomerViewImage" UniqueName="Image" Header="Pictute" TextAlignment="Center" Width="100" HeaderTextAlignment="Center" ImageHeight="40" ImageWidth="40"  DataMemberBinding="{Binding myimage 
, ElementName=window}"/>

Please provide a perfect example.

thank `s  for help
Md.Hasanuzzaman
Top achievements
Rank 1
 answered on 21 Sep 2011
1 answer
150 views
Hello

Does any body know how to add shortcut to RadMenuItem, for example  <New          "Ctrl+Shift+N">? As i see there no out of the box solution?

Thanks in advance.
Konstantina
Telerik team
 answered on 21 Sep 2011
10 answers
186 views

Hi, I have the following style set in my global resource dictionary but it is not being applied to the ScheduleView control since I upgraded to the 2010.3.1314.35 binaries. Used to work fine with version 2010.3.1110. Could someone please explain what the cause of this problem might be? I'm using the StringFormat on the binding to output just the day portion of the date but actually the whole date ('17-02-2011') is being output.

<Style x:Key="TimeRulerGroupItemBaseStyle" TargetType="scheduleView:TimeRulerItemBase">
        <Setter Property="Foreground" Value="{StaticResource RadScheduleForeground}" />
        <Setter Property="Background" Value="{StaticResource GroupHeaderHeaderBackground}" />
        <Setter Property="BorderBrush" Value="{StaticResource GroupHeaderHeaderOuterBorder}" />
        <Setter Property="BorderThickness" Value="1" />
        <Setter Property="HorizontalContentAlignment" Value="Center" />
        <Setter Property="VerticalContentAlignment" Value="Top" />
        <Setter Property="ContentTemplate">
            <Setter.Value>
                <DataTemplate>
                    <TextBlock Padding="0 3" Text="{Binding DateTime, StringFormat='dd'}" />
                </DataTemplate>
            </Setter.Value>
        </Setter>
        <Setter Property="Template">
            <Setter.Value>
                <ControlTemplate TargetType="scheduleView:TimeRulerItemBase">
                    <Grid>
                        <Border x:Name="HeaderVisual" Background="{TemplateBinding Background}" BorderBrush="{TemplateBinding BorderBrush}" BorderThickness="{TemplateBinding BorderThickness}">
                            <Border BorderBrush="{StaticResource GroupHeaderHeaderInnerBorder}" BorderThickness="1" />
                        </Border>
                        <ContentPresenter Margin="0" HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}"
                                          VerticalAlignment="{TemplateBinding VerticalContentAlignment}" />
                    </Grid>
                </ControlTemplate>
            </Setter.Value>
        </Setter>
    </Style>

<Style TargetType="scheduleView:TimeRulerGroupItem" BasedOn="{StaticResource TimeRulerGroupItemBaseStyle}" />

Thanks,
Peter.
Pana
Telerik team
 answered on 21 Sep 2011
Narrow your results
Selected tags
Tags
GridView
General Discussions
Chart
RichTextBox
Docking
ScheduleView
ChartView
TreeView
Diagram
Map
ComboBox
TreeListView
Window
RibbonView and RibbonWindow
PropertyGrid
DragAndDrop
TabControl
TileView
Carousel
DataForm
PDFViewer
MaskedInput (Numeric, DateTime, Text, Currency)
AutoCompleteBox
DatePicker
Buttons
ListBox
GanttView
PivotGrid
Spreadsheet
Gauges
NumericUpDown
PanelBar
DateTimePicker
DataFilter
Menu
ContextMenu
TimeLine
Calendar
Installer and Visual Studio Extensions
ImageEditor
BusyIndicator
Expander
Slider
TileList
PersistenceFramework
DataPager
Styling
TimeBar
OutlookBar
TransitionControl
FileDialogs
Book
ToolBar
ColorPicker
TimePicker
MultiColumnComboBox
SyntaxEditor
VirtualGrid
Wizard
ExpressionEditor
NavigationView (Hamburger Menu)
WatermarkTextBox
DesktopAlert
BarCode
SpellChecker
DataServiceDataSource
EntityFrameworkDataSource
RadialMenu
ChartView3D
Data Virtualization
BreadCrumb
LayoutControl
ProgressBar
Sparkline
TabbedWindow
ToolTip
CloudUpload
ColorEditor
TreeMap and PivotMap
EntityFrameworkCoreDataSource (.Net Core)
HeatMap
Chat (Conversational UI)
VirtualizingWrapPanel
Calculator
NotifyIcon
TaskBoard
TimeSpanPicker
BulletGraph
Licensing
WebCam
CardView
DataBar
FilePathPicker
PasswordBox
SplashScreen
Callout
Rating
Accessibility
CollectionNavigator
Localization
AutoSuggestBox
Security
VirtualKeyboard
HighlightTextBlock
TouchManager
StepProgressBar
Badge
OfficeNavigationBar
ExpressionParser
CircularProgressBar
SvgImage
PipsPager
SlideView
AI Coding Assistant
+? more
Top users last month
Cynthia
Top achievements
Rank 1
Iron
Toby
Top achievements
Rank 3
Iron
Iron
Iron
Danielle
Top achievements
Rank 1
Iron
Iron
Joel
Top achievements
Rank 3
Bronze
Bronze
Iron
yw
Top achievements
Rank 2
Iron
Iron
Iron
Want to show your ninja superpower to fellow developers?
Top users last month
Cynthia
Top achievements
Rank 1
Iron
Toby
Top achievements
Rank 3
Iron
Iron
Iron
Danielle
Top achievements
Rank 1
Iron
Iron
Joel
Top achievements
Rank 3
Bronze
Bronze
Iron
yw
Top achievements
Rank 2
Iron
Iron
Iron
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?