Telerik Forums
UI for WPF Forum
1 answer
113 views
Hello!
Found one problem with radgridviev, which I dont know how to fix.

My scenario:

WPF app for .NET Framework 4
Windows 7 (x64) Ultimate
Version of Telerik dll's: 2011.1.419.40

Here's a structure of document that i'm querying from data source:
Client 
-- Animals
----- Receptions 
(there's other relations like Client - Contacts and so on...)

I show the data to user using the following hierarchy:

RadGridView (showing clients)
-- TabControl
----- RadGridView (showing animals)
---------- TabControl
--------------- RadGridView (showing receptions)


Now, for the problem:

Every RadGridView in hierarchy has handlers for: SelectionChanged, Deleted, RowEditEnded. 
When i add any of SelectionChanged, Deleted, RowEditEnded handler to receptions RadGridView my app shows only the clients grid (the topmost one) with "+" that's not expandable.
Without handlers everything (in leaf RadGridView) works as expected.
If i use a debugger it shows that i have exception: NullReferenceException that's throwed from GridViewRow.OnIsExpandedChanged.

Here's a part of xaml i use :
http://pastebin.com/84hQ9rAP

Any suggestions about what am i doing wrong?

EDIT: 

if i delete "RowStyleSelector="{StaticResource ReceptionRowStyleSelector}" and add handlers to my nested grid - then all seems to work again an there's no exception. But i have no row styling for grid.

That's my ReceptionRowStyleSelector code:

public class ReceptionRowStyleSelector : StyleSelector<br>  
{
  
public override Style SelectStyle(object item, DependencyObject container)
  {            
if (item is Reception)   
{  
            var reception = (Reception)item;
            if (reception.IsCompleted) return CompletedReception;
            
if (reception.IsCanceledByClient) return CanceledReception;
    
if (reception.IsClientNotified) return NotifiedReception;
 }
return DefaultStyle;
 }

...

Styles i use a very simple:

<local:ReceptionRowStyleSelector x:Key="ReceptionRowStyleSelector">
            <local:ReceptionRowStyleSelector.DefaultStyle>
                <Style TargetType="telerik:GridViewRow"></Style>
            </local:ReceptionRowStyleSelector.DefaultStyle>
            <local:ReceptionRowStyleSelector.CompletedReception>
                <Style TargetType="telerik:GridViewRow">
                    <Setter Property="Background" Value="#4502FF49"/>
                </Style>
            </local:ReceptionRowStyleSelector.CompletedReception>
            <local:ReceptionRowStyleSelector.CanceledReception>
                <Style TargetType="telerik:GridViewRow">
                    <Setter Property="Background" Value="#40000000"/>                
                </Style>
            </local:ReceptionRowStyleSelector.CanceledReception>
            <local:ReceptionRowStyleSelector.NotifiedReception>
                <Style TargetType="telerik:GridViewRow">
                    <Setter Property="Background" Value="#4FA4B700"/>
                </Style>
            </local:ReceptionRowStyleSelector.NotifiedReception>
        </local:ReceptionRowStyleSelector>

Thanks, Alex Yakimaskiy

Vlad
Telerik team
 answered on 29 Apr 2011
3 answers
183 views
    <DataTemplate x:Key="CustomToolTipDataTemplate2" x:Name="toolTipTemplate2">
        <StackPanel Margin="10,5">
            <TextBlock FontWeight="Bold" FontFamily="Trebuchet MS" FontSize="12" Text="{Binding Converter={StaticResource ExtendedDataConverter}, ConverterParameter='NAME', StringFormat=County: {0}}" />
            <TextBlock x:Name="KPITip" FontFamily="Trebuchet MS" FontSize="12" Text="{Binding Converter={StaticResource ExtendedDataConverter}, ConverterParameter='PAT_EST', StringFormat='Percentage of Paternity Established: {0:0.##}'}" />
        </StackPanel>
    </DataTemplate>
</Grid.Resources>


How can I programmatically change the ConvertParameter in those TextBlocks and also change the Colorizer ExtendedPropertyName? I can't seem to figure out how to get to them.

Andrey
Telerik team
 answered on 29 Apr 2011
1 answer
142 views
Hi,

If a user double clicks on any element in the RadGridView the RowActivated event fires... This is especially annoying as you double click the text box in the filter options to select all text in the textbox (standard windows things) but this triggers the event.

Thanks,
Maya
Telerik team
 answered on 29 Apr 2011
1 answer
222 views
Is it possible to have a multiple column GridViewComboBoxColumn where the dropdown shows multiple columns - almost like another grid?

I've got a dropdown that concatenates 3 data points and it would be cool if the dropdown rendered a mini-grid of values instead of a list of concatenated string values.  Even cooler would be sorting and filtering within the min-grid...
Maya
Telerik team
 answered on 29 Apr 2011
5 answers
198 views
I'm trying to get a handle to the Grouping Event but I'm not having any luck.
Please Help.
Yavor Georgiev
Telerik team
 answered on 28 Apr 2011
3 answers
85 views
I have a WPF application which calls a dialog using the ShowDialog method and then sets the e.NewObject of the GridView event to the newly created row. Everything works very well, however I am attempting to change the ShowDialog calls to remove the synchronous actions. This is to get the code working in an XBap environment and to get it closer to Silverlight if a port is needed.

I am however baffled as to how to do this without blocking the UI thread to wait for the dialog information.

This is basically what I am doing now:

RadWindow NewWindow = new RadWindow();
  
NewWindow.ShowDialog();
e.NewObject = NewWindow.NewRow;

This is what I would like to do

RadWindow NewWindow = new RadWindow();
  
NewWindow.Closed += delegate
{
  e.NewObject = NewWindow.NewRow;
};
  
NewWindow.Show();
Yavor Georgiev
Telerik team
 answered on 28 Apr 2011
3 answers
203 views
Hi. I'm using the WPF RadTreeListView with EnableRowVirtualization = false and EnableColumnVirtualization = false. I hook the TreeListViewRow's IsExpandedChanged event and, in the handler, I go through all the RadTreeListView's Items. Ultimately, I want to get the item containers (the TreeListViewRows) for each item.

But when an row is collapsed (as opposed to expanded) all its child items disappear from RadTreeListView's Items collection! When I expand the row, the child items come back.

Even if virtualization were on, that should only affect the existance of TreeListViewRows, not the existence of Items. How do I fix this?

Thanks,
   Bob Alexander
Bob
Top achievements
Rank 1
 answered on 28 Apr 2011
1 answer
65 views
I have implemented a class that inherits from the ScheduleView.Appointment class. The only thing that I added to this class is a constructor and 2 properties (Start & End).

When I drag an appointment within the ScheduleView, the Start and End properties (that overload the base class's Start and End properties) are not modified....the break points are never hit.

Since the class that inherits from ScheduleView.Appointment is also going to be wrapping my Model's "Appointment" class...I would really appreciate someone telling me how to get the GUI to update the Start and End properties when you drag the Appointment's start/end points to a new time value.

This is my very very simple appointment class...the start and end properties are never set when I drag an appointment in the ScheduleView:

Public Class TimeZoneAppointment
    Inherits Telerik.Windows.Controls.ScheduleView.Appointment
 
    Private _myModelAppointment As ModelAppointment
 
    Public Overloads Property Start As Date
        Get
            Return MyBase.Start
        End Get
        Set(ByVal value As Date)
            'this will also modify the model appointment's start property
            MyBase.Start = value
        End Set
    End Property
    Public Overloads Property [End] As Date
        Get
            Return MyBase.End
        End Get
        Set(ByVal value As Date)
            'this will also modify the model appointment's end property
            MyBase.End = value
        End Set
    End Property
 
 
 
    Public Sub New(ByVal ma As ModelAppointment)
        MyBase.New()
        _myModelAppointment = ma
         
        MyBase.Start = _myModelAppointment.startDate
        MyBase.End = _myModelAppointment.endDate
 
        Dim recurrencePattern As New RecurrencePattern()
        recurrencePattern.Frequency = RecurrenceFrequency.Weekly
        Dim recurrenceRule As New RecurrenceRule(recurrencePattern)
 
        MyBase.RecurrenceRule = recurrenceRule
 
    End Sub
End Class


Thanks for your time and help!
newbie
Top achievements
Rank 1
 answered on 28 Apr 2011
1 answer
448 views
Let me explain the scenario:

In a WPF-Window i have a grid with one row and three columns. The columns are used as follow:
Column 0 => RadDocking
Column 1 => GridSplitter
Column 2 => A ContentControl

When moving the gridsplitter, the raddocking will be resized well. But:

The RadDocking contains for example two panes. If i minimize the panes, they are shown on the left site - as expected. But the GridSplitter did not "follow to the left".

Okay - the RadDocking is "working" in the area defined by grid column 0 and may be it did not know anything about other controls in the grid that must be resized if all panes in a raddocking are minimzed. Is there a solution?

I have a small example app that shows the problem at runtime - below the xaml of the window.

Regards
Jan Waiz

<Window x:Class="WPFprismMEFRadDockingTest.Views.ShellView"
        xmlns:prism="http://www.codeplex.com/prism"
        xmlns:controls="clr-namespace:WPFprismMEFRadDockingTest.Controls"
        xmlns:telerik="http://schemas.telerik.com/2008/xaml/presentation"  
        xmlns:telerikControls="clr-namespace:Telerik.Windows.Controls;assembly=Telerik.Windows.Controls"
        Title="Prism Shell" WindowStartupLocation="CenterScreen" Height="620" Width="850"
        Icon="../Images/PnPIcon.ico"
        mc:Ignorable="d" d:DesignHeight="720" d:DesignWidth="900">
    <Window.Background>
        <ImageBrush ImageSource="/Images/background.jpg"  Stretch="UniformToFill"/>
    </Window.Background>
    <Window.Resources>
    </Window.Resources>
  
    <Grid x:Name="LayoutRoot">
        <Grid.RowDefinitions>
            <RowDefinition Height="100"/>
            <RowDefinition Height="*"/>
        </Grid.RowDefinitions>
        <Grid.ColumnDefinitions>
            <ColumnDefinition Width="1*" MinWidth="25"/>
            <ColumnDefinition Width="Auto"/>
            <ColumnDefinition Width="3*"/>
        </Grid.ColumnDefinitions>
  
        <!-- When minimizing the 2 panes, they will be showed at the left site -->
        <!-- but the area (defined by the grid) is not minimized, too. And the -->
        <!-- control in the right grid-area did not use the full space. Seems, -->
        <!-- that the gridsplitter did not "follow" the minimized panes...     -->
        <telerik:RadDocking x:Name="LeftRadDocking" 
                                telerikControls:StyleManager.Theme="Transparent" 
                                HasDocumentHost="False" 
                                Grid.Row="1" Grid.Column="0"
                                Margin="10,5,5,10" 
                                Padding="0">
            <telerik:RadDocking.Background>
                <SolidColorBrush />
            </telerik:RadDocking.Background>
            <telerik:RadDocking.BorderBrush>
                <SolidColorBrush />
            </telerik:RadDocking.BorderBrush>
              
            <telerik:RadSplitContainer Name="LeftRadSplitContainer" 
                                       Background="#99FFFFFF" Opacity="0.5"
                                       InitialPosition="DockedLeft">
                <telerik:RadPaneGroup Opacity="1">
                      
                    <telerik:RadPaneGroup.Background>
                        <SolidColorBrush />
                    </telerik:RadPaneGroup.Background>
                      
                    <telerik:RadPane Header="Pane Left 1">
                        <telerik:RadPane.Content>
                            <TextBlock TextWrapping="Wrap" 
                                       Text="This is Pane Left 1 to fill the area with some senseless text." />
                        </telerik:RadPane.Content>
                    </telerik:RadPane>
                    <telerik:RadPane Header="Pane Left 2" Content="Pane Left 2" >
                    </telerik:RadPane>
                </telerik:RadPaneGroup>
            </telerik:RadSplitContainer>
        </telerik:RadDocking>
  
        <GridSplitter Grid.Row="1" Grid.Column="1"
                      HorizontalAlignment="Center" 
                      VerticalAlignment="Stretch"
                      Width="5" 
                      ShowsPreview="True" 
                      ResizeDirection="Columns" 
                      Background="Transparent"/>
  
        <ContentControl x:Name="DesktopRegion"
                        Grid.Row="1" Grid.Column="2"
                        Margin="5,5,15,10">
            <ContentControl.Template>
                <ControlTemplate TargetType="ContentControl">
                    <Grid>
                        <controls:RoundedBox />
                        <ContentPresenter Margin="10,0,10,0" Content="{TemplateBinding Content}" />
                    </Grid>
                </ControlTemplate>
            </ContentControl.Template>
        </ContentControl>
  
    </Grid>
</Window>
Dani
Telerik team
 answered on 28 Apr 2011
1 answer
151 views
I'm trying to have the Legend lay on top of the chart area. To my understanding the following code should work. I am setting my data in codebehind. If I change the value of UseDefaultLayout to True the chart control displays the correct chart by using the default ChartArea and default ChartLegend etc. However, when I set UseDefaultLayout to False, like in the code below, the ChartArea displays the error No Series Data. The ChartLegend is located at the desired location so I need to know why my data is not being displayed. Please help me understand why this is not working and how to fix it.

<DataTemplate x:Key="ChartDataTemplate"
    <telerik:RadChart x:Name="Chart" UseDefaultLayout="False"
        <Grid
            <Grid.RowDefinitions
                <RowDefinition Height="1*" /> 
                <RowDefinition Height="19*" /> 
            </Grid.RowDefinitions
            <Grid.ColumnDefinitions
                <ColumnDefinition Width="19*" /> 
                <ColumnDefinition Width="1*" /> 
            </Grid.ColumnDefinitions
            <telerik:ChartLegend x:Name="LegendArea"
                                 Grid.Row="1"
                                 Grid.Column="0"
                                 HorizontalAlignment="Right"
                                 VerticalAlignment="Top" /> 
            <telerik:ChartArea LegendName="LegendArea" /> 
        </Grid
    </telerik:RadChart
</DataTemplate>
Thank you,
Danny
Evgenia
Telerik team
 answered on 28 Apr 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
Boardy
Top achievements
Rank 2
Veteran
Iron
Benjamin
Top achievements
Rank 3
Bronze
Iron
Veteran
ivory
Top achievements
Rank 1
Iron
Iron
Rob
Top achievements
Rank 3
Bronze
Bronze
Iron
ClausDC
Top achievements
Rank 2
Iron
Iron
Iron
Want to show your ninja superpower to fellow developers?
Top users last month
Boardy
Top achievements
Rank 2
Veteran
Iron
Benjamin
Top achievements
Rank 3
Bronze
Iron
Veteran
ivory
Top achievements
Rank 1
Iron
Iron
Rob
Top achievements
Rank 3
Bronze
Bronze
Iron
ClausDC
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?