Telerik Forums
UI for WPF Forum
16 answers
541 views
I have a three-level hierarchical grid that shows Matches/Teams/Players.  The display works fine.  
Now I'm trying to drag-and-drop items onto that grid and need to know which row I'm over when the drop occurs.

Per some of your examples, I've added an event handler for the RowLoaded/Unloaded events in which I add event handlers for MouseEnter/Leave for each row.  This works fine for the top (Game) level of the grid, and second (Teams) level, but when I add any event handlers for the Players grid, I'm having problems.

If all three levels have event handlers, when I attempt to expand the top-level grid, I get an exception as shown below.  This happens regardless of whether I have separate event handlers for each level, or a shared/generic handler.  As soon as I remove the event handlers (RowLoaded in this code snippet) in my third-level child grid, everything's fine, except of course that my application doesn't work. :)

Baffled and stuck.  

-Lynne W

Example of the XAML with event handlers for RowLoaded/Unloaded.  Same thing happens for MouseEnter/Leave.  This causes the exception shown at the end of this message.
<telerik:RadGridView Name="gridMatchPlayers"
                                         AutoGenerateColumns="False"
                                         ItemsSource="{Binding MatchPlayers}"
                                         ShowGroupPanel="False"
                                         RowLoaded="MatchPlayerGrid_RowLoaded"
                                         RowUnloaded="MatchPlayerGrid_RowUnloaded"
                                         telerikDragDrop:RadDragAndDropManager.AllowDrag="False"
                                         telerikDragDrop:RadDragAndDropManager.AllowDrop="True">

Event handling code for Player row event handlers
  • Note that I have the add'l MouseEnter/Leave event handlers commented out.  I've tried Row and Mouse event handlers for my Player (third-level) grid and they cause the exception seen below.
////////////////////////////////////////////////////////////////////////////////
//     //
//  //////  MatchPlayer grid
//   //
//
void MatchPlayerGrid_RowLoaded(Object sender, Telerik.Windows.Controls.GridView.RowLoadedEventArgs e) {
    var row = e.Row as GridViewRow;
    if (row != null) {
        //row.MouseEnter += new MouseEventHandler(MatchPlayerGridRow_MouseEnter);
        //row.MouseLeave += new MouseEventHandler(MatchPlayerGridRow_MouseLeave);
     }
}
 
void MatchPlayerGrid_RowUnloaded(object sender, RowUnloadedEventArgs e) {
    var row = e.Row as GridViewRow;
    if (row != null) {
        //row.MouseEnter += new MouseEventHandler(MatchPlayerGridRow_MouseEnter);
        //row.MouseLeave += new MouseEventHandler(MatchPlayerGridRow_MouseLeave);
    }
}
 
 
void MatchPlayerGridRow_MouseEnter(Object sender, System.Windows.Input.MouseEventArgs e) {
    var senderElement = e.OriginalSource as FrameworkElement;
    var mouseOverRow = senderElement.ParentOfType<GridViewRow>();
}
 
void MatchPlayerGridRow_MouseLeave(Object sender, MouseEventArgs e) {
    var senderElement = e.OriginalSource as FrameworkElement;
    var mouseExitRow = senderElement.ParentOfType<GridViewRow>();
}


Exception thrown when a third-level child grid has extant/active event handlers

System.NullReferenceException was unhandled by user code
  Message=Object reference not set to an instance of an object.
  Source=ccm3
  StackTrace:
       at ccm3.ContentControls.ucMatchManagement.System.Windows.Markup.IStyleConnector.Connect(Int32 connectionId, Object target) in f:\PredatorGames\src\ccm3\trunk\ccm3\ContentControls\ucMatchManagement.xaml:line 245
       at System.Windows.FrameworkTemplate.LoadTemplateXaml(XamlReader templateReader, XamlObjectWriter currentWriter)
       at System.Windows.FrameworkTemplate.LoadTemplateXaml(XamlObjectWriter objectWriter)
       at System.Windows.FrameworkTemplate.LoadOptimizedTemplateContent(DependencyObject container, IComponentConnector componentConnector, IStyleConnector styleConnector, List`1 affectedChildren, UncommonField`1 templatedNonFeChildrenField)
       at System.Windows.FrameworkTemplate.LoadContent(DependencyObject container, List`1 affectedChildren)
       at System.Windows.FrameworkTemplate.LoadContent()
       at Telerik.Windows.Controls.GridView.GridViewRow.PopulateHierarchyContent() in c:\TB\102\WPF_Scrum\Release_WPF_40\Sources\Development\Controls\GridView\GridView\GridView\Rows\GridViewRow.cs:line 304
       at Telerik.Windows.Controls.GridView.GridViewRow.OnIsExpandedChanged(Boolean oldValue, Boolean newValue) in c:\TB\102\WPF_Scrum\Release_WPF_40\Sources\Development\Controls\GridView\GridView\GridView\Rows\GridViewRow.cs:line 230
       at Telerik.Windows.Controls.GridView.GridViewRow.OnIsExpandedChanged(DependencyObject dependencyObject, DependencyPropertyChangedEventArgs e) in c:\TB\102\WPF_Scrum\Release_WPF_40\Sources\Development\Controls\GridView\GridView\GridView\Rows\GridViewRow.cs:line 205
       at System.Windows.DependencyObject.OnPropertyChanged(DependencyPropertyChangedEventArgs e)
       at System.Windows.FrameworkElement.OnPropertyChanged(DependencyPropertyChangedEventArgs e)
       at System.Windows.DependencyObject.NotifyPropertyChange(DependencyPropertyChangedEventArgs args)
       at System.Windows.DependencyObject.UpdateEffectiveValue(EntryIndex entryIndex, DependencyProperty dp, PropertyMetadata metadata, EffectiveValueEntry oldEntry, EffectiveValueEntry& newEntry, Boolean coerceWithDeferredReference, Boolean coerceWithCurrentValue, OperationType operationType)
       at System.Windows.DependencyObject.SetValueCommon(DependencyProperty dp, Object value, PropertyMetadata metadata, Boolean coerceWithDeferredReference, Boolean coerceWithCurrentValue, OperationType operationType, Boolean isInternal)
       at MS.Internal.Data.PropertyPathWorker.SetValue(Object item, Object value)
       at MS.Internal.Data.ClrBindingWorker.UpdateValue(Object value)
       at System.Windows.Data.BindingExpression.UpdateSource(Object value)
  InnerException: 

Maya
Telerik team
 answered on 12 Dec 2011
1 answer
42 views
Hi,

We are using telerik's data grid view to show multi-level hierarchical data grid. When you select something from the child criteria drop down a new node in the child grid is created.

But the problem is that we cannot expand the child grid through the toggle button. We get an exception in the output window. However when we change our project setting to .NET 4.0, everything works fine. Since our main project is using .NET 4.0 we wanted to make sure that the multi level data grid works for us.

Can you please test out the attached test project and see how to make the hierarchical data grid work with .NET 4.0.

Thanks,
Farhan

PS: It seems that I cannot attach the project here. Is there any way I can send it to you guys !
Maya
Telerik team
 answered on 12 Dec 2011
2 answers
139 views
Dear Community, dear Telerik - Team,

I´ve got a question on RadChart for WPF.
For coding i use c# on .net 4.0

Intro:
I use a Telerik RadChart for showing items of a observable collection.
I got an UI, on which you can enter specific parameters and then safe it as an entry to this collection by clicking a button as often as you wish.
By pressing a second button, the application turns on to the next page on which the Chart ist implemented.
The Chart itself is a RadChart working with bars. The data is displayed correctly and everything runs fine.

Problem:
The bars of the RadChart are animated and popping up from left to right.
I set the TotalAnimationDuration to 7 secs.
I want the mousecursor to be a WAITCURSOR as long as the animation is runnig, means, till every bar is finally displayed.

Is there any chance this is possible?

Thanks in advance!
Bartholomeo Rocca
Top achievements
Rank 1
 answered on 09 Dec 2011
1 answer
93 views
I am showing appointments grouped by resources.  When a resource is associated with an appointment, I add an additional piece of information (i.e. when a person is added to an appointment, they can be made the "moderator" of the appointment, but they may be just a "participant" on another appointment).

When I show the person as the group header, then I show the appointments they are on. It would be nice to show their "role" on the appointment (as a tooltip or as text on the appointment). Unfortunately, when grouping by resources, I can not figure out how to show which resource row/column the appointment is currently showing in.  Is this possible?

Thanks,

Michael
Valeri Hristov
Telerik team
 answered on 09 Dec 2011
1 answer
79 views
Hi Folks,
I've got a kind of "activation problem" or "focus problem" with the crystal reports viewer in a RadDocking pane.
When you switch to another RadDocking Pane and switch back, the Crystal toolbar is disabled.
It seems the pane "steals" the focus. (when you press TAB twice the focus is in the CR viewer again and the toolbar is activated again)

What should I do to have the viewer constanly enabled ?

Please refer to two screenshots: "before pane switch.jpg" and "after pane switch.jpg".
I could also upload a demo app I made.
Please help me.

Best regards
Oliver Abraham
Konstantina
Telerik team
 answered on 09 Dec 2011
6 answers
426 views
Hi,
I need to have the tileviewitems without the header. It's posible to do that?
Greetings.
soroush
Top achievements
Rank 1
 answered on 09 Dec 2011
2 answers
95 views
Hi,
I have this tileview to present some thumbnails:
<telerik:RadTileView
x:Name="SearchResultsListBox" SelectionChanged="SearchResultsListBox_SelectionChanged" 
IsSelectionEnabled="True"
SelectionMode="Single"
Background="White"                                                
ContentTemplateSelector="{StaticResource RTS}"
TileStateChangeTrigger="None"
IsItemsAnimationEnabled="False"
ColumnsCount="3"                                                                                                                                               
MinHeight="185">
</telerik:RadTileView>
I dynamically fill the "Items" and When the height of items gets bigger than MinHeight value I need that vertical scrollbar to appear, but it wont, what is the problem?
soroush
Top achievements
Rank 1
 answered on 09 Dec 2011
1 answer
82 views
Hi

is it possible to use the im / export functions without a UI ?

I've to convert HTML Content from a database to doc(x) and PDF within a batch / Console application.
Ivailo Karamanolev
Telerik team
 answered on 09 Dec 2011
1 answer
129 views
Hi Telerik,

Im currently styling the GridLines for my chart. The problem appears when I enable the GridLines with a strokethickness of 1. You now see some gridlines not snapping to the device pixels (which causes the gridline to be blurry or sharp).

This behavior is also apparent in your GridViewSample: http://demos.telerik.com/silverlight/#Chart/CustomGridLines

I've tried to customize the AxisStyles and setting SnapToDevicePixels, but this doesnt work.

Do you have a sample which fixes the blurry GridLines?
Sia
Telerik team
 answered on 09 Dec 2011
4 answers
113 views
Hello,
I've used the PrintExtension class you've provided with WPF 2011 SP1 examples but when I click the print button it's not possible to set a range of pages... if my grid has 20.000 records I don't want be responsable of Amazonian's forest harvest....
is it possible to choose a range? how to enable it? my Grid doesn't have pagination but as far I've seen that's no the problem...

Thanks

Paolo

Michele
Top achievements
Rank 2
 answered on 09 Dec 2011
Narrow your results
Selected tags
Tags
+? more
Top users last month
Anislav
Top achievements
Rank 6
Silver
Bronze
Bronze
Jianxian
Top achievements
Rank 1
Iron
Marco
Top achievements
Rank 3
Iron
Iron
Iron
Jim
Top achievements
Rank 2
Iron
Iron
Nurik
Top achievements
Rank 2
Iron
Iron
Want to show your ninja superpower to fellow developers?
Top users last month
Anislav
Top achievements
Rank 6
Silver
Bronze
Bronze
Jianxian
Top achievements
Rank 1
Iron
Marco
Top achievements
Rank 3
Iron
Iron
Iron
Jim
Top achievements
Rank 2
Iron
Iron
Nurik
Top achievements
Rank 2
Iron
Iron
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?