Telerik Forums
UI for WPF Forum
1 answer
112 views

The header of the SW is visible but there nothing in the content area, bank white not even the no appointments text.

Attaching sample project and image

App.xaml:

 <ResourceDictionary>
            <ResourceDictionary.MergedDictionaries>
                <ResourceDictionary Source="/Themes/System.Windows.xaml"/>
                <ResourceDictionary Source="/Themes/Telerik.Windows.Controls.xaml"/>
                <ResourceDictionary Source="/Themes/Telerik.Windows.Controls.Input.xaml"/>
                <ResourceDictionary Source="/Themes/Telerik.Windows.Controls.Navigation.xaml"/>
                <ResourceDictionary Source="/Themes/Telerik.Windows.Controls.ScheduleView.xaml"/>
            </ResourceDictionary.MergedDictionaries>

        </ResourceDictionary>

 

UC:

        xmlns:telerik="http://schemas.telerik.com/2008/xaml/presentation" >
    <Grid>

        <telerik:RadScheduleView  >
            <telerik:RadScheduleView.ViewDefinitions>
                <telerik:DayViewDefinition DayStartTime="8:00" />
                <telerik:WeekViewDefinition DayStartTime="8:00" />
                <telerik:MonthViewDefinition />
                <telerik:TimelineViewDefinition />
                <telerik:AgendaViewDefinition />
            </telerik:RadScheduleView.ViewDefinitions>
        </telerik:RadScheduleView>
    </Grid>


Is there anything I am doing wrong?

Thank you.

Esh
Top achievements
Rank 1
Iron
 answered on 14 Oct 2021
1 answer
3.4K+ views

Hi, I'm trying to set focus on a textbox in a grid with a 'New' button click.  the button has style setter to enable the text box on click, but i cannot get the textbox to get focus.  best i can get is the cursor frozen in the textbox, requiring user to hit tab or enter.  All my searching is saying there's a bug that will be fixed - years ago.  I'm running the current version 2021.R3

trying the focusmanager does nothing.  Here is the code:

<UserControl x:Class="Arc2.App.Views.JobNoteVw"
             xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
             xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
             xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" 
             xmlns:d="http://schemas.microsoft.com/expression/blend/2008" 
             xmlns:local="clr-namespace:Arc2.App.Views"
xmlns:Utils="clr-namespace:Arc2.App.Controls"
xmlns:i="clr-namespace:System.Windows.Interactivity;assembly=System.Windows.Interactivity"
xmlns:telerik="http://schemas.telerik.com/2008/xaml/presentation" 
mc:Ignorable="d" 
d:DesignHeight="500" d:DesignWidth="560">
    <Grid>
        <Grid.Style>
            <Style>
                <Style.Triggers>
                    <DataTrigger Binding="{Binding IsNew}" Value="True">
                        <Setter Property="FocusManager.FocusedElement" Value="{Binding ElementName=txNote}"/>
                    </DataTrigger>
                </Style.Triggers>
            </Style>

        </Grid.Style>
        <Grid.Background>
            <LinearGradientBrush StartPoint="0,1" EndPoint="0,0">
                <GradientStop Offset="0" Color="White"/>
                <GradientStop Offset="1" Color="CadetBlue"/>
            </LinearGradientBrush>
        </Grid.Background>

        <Grid.ColumnDefinitions>
            <ColumnDefinition Width="120"/>
            <ColumnDefinition Width="155"/>
            <ColumnDefinition Width="*"/>
            <ColumnDefinition Width="155"/>
        </Grid.ColumnDefinitions>
        <Grid.RowDefinitions>
            <RowDefinition Height="32"/>
            <RowDefinition Height="32"/>
            <RowDefinition Height="35"/>
            <RowDefinition Height="*"/>
            <RowDefinition Height="35"/>
            <RowDefinition Height="35"/>
            <RowDefinition Height="4"/>
            <RowDefinition Height="35"/>
            <RowDefinition Height="3*"/>
        </Grid.RowDefinitions>
        <!--Row 0-->
        <TextBlock Text="WO Number:" Margin="10,0,10,5" VerticalAlignment="Bottom"  TextAlignment="Right" Height="16" />
        <TextBlock Text="Job Number:" Margin="10,0,10,5" Grid.Row="1" VerticalAlignment="Bottom"  TextAlignment="Right" Height="16" />
        <TextBlock x:Name="txtWo" Text="{Binding SelJob.TrackingNumber, Mode=OneWay}" Grid.Column="1" IsEnabled="False"
HorizontalAlignment="Stretch" Margin="5,0,5,5" VerticalAlignment="Bottom" Foreground="DarkGreen" Height="16" />
        <TextBlock x:Name="txtJob" Text="{Binding SelJob.JobNumber, Mode=OneWay}" Grid.Row="1" Grid.Column="1" IsEnabled="False" 
HorizontalAlignment="Stretch" Margin="5,0,5,5" VerticalAlignment="Bottom" Foreground="DarkGreen" Height="16" />
        <!-- Row 2-->
        <TextBlock Text="Job Description:" Grid.Row="2" Margin="10,5,10,0" TextAlignment="Right"/>
        <TextBox x:Name="txtJobDesc" Grid.Row="2" Grid.Column="1" Grid.ColumnSpan="3"
                 Text="{Binding SelJob.JobDescription, Mode=OneWay}" IsEnabled="False"
                 Margin="5" VerticalScrollBarVisibility="Auto" TextWrapping="Wrap" TabIndex="1" IsTabStop="True"/>

        <!--Row 3-->
        <TextBlock Text="Note:" Grid.Row="3" Margin="10,5,10,0" TextAlignment="Right"/>

        <Grid x:Name="d1" Grid.Row="3" Grid.Column="1" Grid.ColumnSpan="3"
VerticalAlignment="Stretch"
                    FocusManager.FocusedElement="{Binding ElementName=TxNote}">
            <Grid.Style>
                <Style>
                    <Style.Triggers>
                        <DataTrigger Binding="{Binding HasRows}" Value="False">
                            <Setter Property="Grid.IsEnabled" Value="False"/>
                        </DataTrigger>
                        <DataTrigger Binding="{Binding HasRows}" Value="True">
                            <Setter Property="Grid.IsEnabled" Value="True"/>
                        </DataTrigger>
                    </Style.Triggers>
                </Style>
            </Grid.Style>
            <TextBox x:Name="TxNote" Text="{Binding TmpJobNote.Note}" VerticalAlignment="Stretch"
Margin="5,3" VerticalScrollBarVisibility="Auto" TextWrapping="Wrap"
                     IsTabStop="False" KeyboardNavigation.IsTabStop="False">
                <TextBox.Style>
                    <Style>
                        <Style.Triggers>
                            <DataTrigger Binding="{Binding IsEdit}" Value="True">
                                <Setter Property="TextBox.IsEnabled"  Value="True"/>
                            </DataTrigger>
                            <DataTrigger Binding="{Binding IsEdit}" Value="False">
                                <Setter Property="TextBox.IsEnabled"  Value="False"/>
                            </DataTrigger>
                        </Style.Triggers>
                    </Style>
                </TextBox.Style>
            </TextBox>
        </Grid>
        <!-- Row 4 -->
        <TextBlock Text="Effective Date:"
   Grid.Row="4" VerticalAlignment="Center"
   Margin="10,9,10,10" TextAlignment="Right" Height="16" />
        <telerik:RadDatePicker x:Name="d3"
   Grid.Row="4" Grid.Column="1" VerticalAlignment="Center"
   SelectedValue="{Binding TmpJobNote.TimeStamp}"
                                   DateTimeWatermarkContent="Select Date..."
                                   TodayButtonVisibility="Visible"
   Margin="5,1" HorizontalAlignment="Stretch" Height="22">
            <telerik:RadDatePicker.Style>
                <Style>
                    <Style.Triggers>
                        <DataTrigger Binding="{Binding HasRows}" Value="False">
                            <Setter Property="telerik:RadDatePicker.IsEnabled" Value="False"/>
                        </DataTrigger>
                        <DataTrigger Binding="{Binding HasRows}" Value="True">
                            <Setter Property="telerik:RadDatePicker.IsEnabled" Value="True"/>
                        </DataTrigger>
                        <DataTrigger Binding="{Binding IsEdit}" Value="True">
                            <Setter Property="telerik:RadDatePicker.IsEnabled"  Value="True"/>
                        </DataTrigger>
                        <DataTrigger Binding="{Binding IsEdit}" Value="False">
                            <Setter Property="telerik:RadDatePicker.IsEnabled"  Value="False"/>
                        </DataTrigger>
                    </Style.Triggers>
                </Style>
            </telerik:RadDatePicker.Style>
        </telerik:RadDatePicker>
        <TextBlock Text="Author:" Margin="10,7" Grid.Row="4" Grid.Column="2" VerticalAlignment="Center" TextAlignment="Right" Height="16" />
        <!--<telerik:RadDatePicker x:Name="dtTimeStamp" Width="150" Margin="0,2" HorizontalAlignment="Left" />-->
        <TextBox x:Name="txtAuthor" Text="{Binding AuthorNm}" Grid.Row="4" Grid.Column="3"
Margin="5" HorizontalAlignment="Stretch" IsReadOnly="True">
            <TextBox.Style>
                <Style>
                    <Style.Triggers>
                        <DataTrigger Binding="{Binding IsEdit}" Value="True">
                            <Setter Property="TextBox.IsEnabled"  Value="True"/>
                        </DataTrigger>
                        <DataTrigger Binding="{Binding IsEdit}" Value="False">
                            <Setter Property="TextBox.IsEnabled"  Value="False"/>
                        </DataTrigger>

                    </Style.Triggers>
                </Style>
            </TextBox.Style>
        </TextBox>

        <!--Row 5-->
        <TextBlock Text="Date Added:" Grid.Row="5" Margin="0,9,10,10" HorizontalAlignment="Right" VerticalAlignment="Center" Height="16" Width="66" />
        <TextBox x:Name="txtDtAdd" Text="{Binding TmpJobNote.DateAdded}"
Grid.Column="1" Grid.Row="5" Margin="5,5" IsReadOnly="True" IsTabStop="False" />
        <TextBlock Text="Date Updated:" Margin="5,9,5,10"
   Grid.Row="5" Grid.Column="2" VerticalAlignment="Center" TextAlignment="Right" Height="16" />
        <TextBox x:Name="txtDtUpdate" Text="{Binding TmpJobNote.DateUpdated}"
Grid.Row="5" Grid.Column="3"
Margin="5,5" IsReadOnly="True" IsTabStop="False" />
        <!--Row 7-->
        <StackPanel Orientation="Horizontal" Grid.Row="7" Grid.ColumnSpan="4" HorizontalAlignment="Center" Margin="8,0" Width="544">
            <Button Content="New" Margin="15,2" Width="70" FontWeight="Bold"
Command="{Binding NewCommand}">
                <Button.Style>
                    <Style>
                        <Style.Triggers>
                            <DataTrigger Binding="{Binding IsNew}" Value="True">
                                <Setter Property="Button.IsEnabled"  Value="False"/>
                            </DataTrigger>
                            <DataTrigger Binding="{Binding IsNew}" Value="False">
                                <Setter Property="Button.IsEnabled"  Value="True"/>
                            </DataTrigger>
                            <DataTrigger Binding="{Binding IsEdit}" Value="True">
                                <Setter Property="Button.IsEnabled"  Value="False"/>
                            </DataTrigger>
                            <DataTrigger Binding="{Binding IsEdit}" Value="False">
                                <Setter Property="Button.IsEnabled"  Value="True"/>
                            </DataTrigger>
                        </Style.Triggers>
                    </Style>
                </Button.Style>
            </Button>
            <Button Content="Save" Margin="15,2" Width="70" FontWeight="Bold"
Command="{Binding SaveCommand}">
                <Button.Style>
                    <Style>
                        <Style.Triggers>
                            <DataTrigger Binding="{Binding IsEdit}" Value="True">
                                <Setter Property="Button.IsEnabled"  Value="True" />
                            </DataTrigger>
                            <DataTrigger Binding="{Binding IsEdit}" Value="False">
                                <Setter Property="Button.IsEnabled"  Value="False" />
                            </DataTrigger>
                        </Style.Triggers>
                    </Style>
                </Button.Style>
            </Button>
            <Button Content="Edit" Margin="15,2" Width="70" FontWeight="Bold"
Command="{Binding EditCommand}">
                <Button.Style>
                    <Style>
                        <Style.Triggers>
                            <DataTrigger Binding="{Binding IsEdit}" Value="True">
                                <Setter Property="Button.IsEnabled"  Value="False"/>
                            </DataTrigger>
                            <DataTrigger Binding="{Binding IsEdit}" Value="False">
                                <Setter Property="Button.IsEnabled"  Value="True"/>
                            </DataTrigger>
                            <DataTrigger Binding="{Binding HasRows}" Value="False">
                                <Setter Property="Button.IsEnabled" Value="False"/>
                            </DataTrigger>
                            <DataTrigger Binding="{Binding HasRows}" Value="True">
                                <Setter Property="Button.IsEnabled" Value="True"/>
                            </DataTrigger>
                        </Style.Triggers>
                    </Style>
                </Button.Style>
            </Button>
            <Button Content="Cancel" Margin="15,2" Width="70" FontWeight="Bold"
Command="{Binding CancelCommand}">
                <Button.Style>
                    <Style>
                        <Style.Triggers>
                            <DataTrigger Binding="{Binding IsEdit}" Value="True">
                                <Setter Property="Button.Visibility"  Value="Visible"/>
                            </DataTrigger>
                            <DataTrigger Binding="{Binding IsEdit}" Value="False">
                                <Setter Property="Button.Visibility"  Value="Collapsed"/>
                            </DataTrigger>
                        </Style.Triggers>
                    </Style>
                </Button.Style>
            </Button>
            <Button Content="Delete" Margin="65,2,10,2" Width="70" FontWeight="Bold"
Command="{Binding DeleteCommand}">
                <Button.Style>
                    <Style>
                        <Style.Triggers>
                            <DataTrigger Binding="{Binding IsNew}" Value="True">
                                <Setter Property="Button.IsEnabled"  Value="False"/>
                            </DataTrigger>
                            <DataTrigger Binding="{Binding IsNew}" Value="False">
                                <Setter Property="Button.IsEnabled"  Value="True"/>
                            </DataTrigger>
                        </Style.Triggers>
                    </Style>
                </Button.Style>
            </Button>
        </StackPanel>

        <!--Row 5-->
        <telerik:RadGridView HorizontalAlignment="Stretch"
x:Name="gvJobNote"
Margin="5,5,5,0"
Grid.Row="8"
Grid.ColumnSpan="4"
VerticalAlignment="Top"
EnableLostFocusSelectedState="False"
RowIndicatorVisibility="Collapsed"
AutoGenerateColumns="False"
AlternationCount="2"
IsReadOnly="True"
ItemsSource="{Binding JobNoteList}"
SelectedItem="{Binding SelJobNote}"
AlternateRowBackground="#FFB4D2D3">
            <i:Interaction.Behaviors>
                <Utils:GridViewScrollIntoView/>
            </i:Interaction.Behaviors>
            <telerik:RadGridView.Columns>
                <telerik:GridViewDataColumn Header="Eff Dt" DataMemberBinding="{Binding TimeStamp}" DataFormatString="{} {0:MM/dd/yyyy}" HeaderTextAlignment="Center" Width="85" TextAlignment="Center" />
                <telerik:GridViewDataColumn Header="Note" DataMemberBinding="{Binding Note}" TextAlignment="Left" Width="*" HeaderTextAlignment="Center"  />
                <telerik:GridViewDataColumn Header="Author" DataMemberBinding="{Binding Author}" HeaderTextAlignment="Center" Width="90" />
                <telerik:GridViewDataColumn Header="Added" DataMemberBinding="{Binding DateAdded}" HeaderTextAlignment="Center" Width="140" TextAlignment="Right" />
                <telerik:GridViewDataColumn Header="Updated" DataMemberBinding="{Binding DateUpdated}" Width="140" HeaderTextAlignment="Center" />
            </telerik:RadGridView.Columns>

        </telerik:RadGridView>

    </Grid>
</UserControl>
Stenly
Telerik team
 answered on 13 Oct 2021
1 answer
321 views

Hello.

I created a bar chart similar to the link below.

The chart is successful, but there is a problem with sorting in categories.

https://docs.telerik.com/devtools/universal-windows-platform/controls/radchart/how-to/howto-display-horizontal-bar-chart

 


<telerik:RadCartesianChart>
    <telerik:RadCartesianChart.HorizontalAxis>
        <telerik:LinearAxis/>
    </telerik:RadCartesianChart.HorizontalAxis>
    <telerik:RadCartesianChart.VerticalAxis>
        <telerik:CategoricalAxis/>
    </telerik:RadCartesianChart.VerticalAxis>

    <telerik:RadCartesianChart.Series>
        <telerik:BarSeries	ItemsSource="{Binding ResultChart}"
							CategoryBinding="Title"
                            ValueBinding="Value" 
							ShowLabels="True">

            <telerik:BarSeries.DefaultVisualStyle>
                <Style TargetType="Border">
                    <Setter Property="Background" Value="{Binding DataItem.Color}" />
                </Style>
            </telerik:BarSeries.DefaultVisualStyle>
        </telerik:BarSeries>
    </telerik:RadCartesianChart.Series>
</telerik:RadCartesianChart>

<telerik:GridView ItemSource="{Binding ResultChart}" /> 

As you can see, Category 0 is the first value, and you can see that it is below.

I want to reverse this.

Is there another way other than to sort the Itemsource binding values ​​in reverse?

I want to avoid sorting because the results are also displayed in the GridView.

 

Thanks.

Martin Ivanov
Telerik team
 answered on 13 Oct 2021
1 answer
112 views
How can I copy a text with bullets/numeric to another richtextbox ? Do a clipboard of a richtextbox still alive after close that richtextbox
Tanya
Telerik team
 answered on 13 Oct 2021
1 answer
151 views

Hello

 

I am showing a RadChartView which has a bar series.

I have varying data and sometimes logarithmic is better and sometimes linear axis is better.

How can I provide a button to dynamically switch between Linear Axis and Logartihmic Axis on the vertical axis?

I prefer using XAML and data binding in XAML. is this possible?

 

 

 

Martin Ivanov
Telerik team
 answered on 13 Oct 2021
1 answer
132 views

Hi,

I observed that when the tooltip disappears, I need to move out of control before I can see the tooltip again (also in your sample with England map you can see this effect). It is reasonable, but I have a control that display a histogram plot. I could move the mouse over different bar and I would like that the tooltip could show again.
Is there a way to reactivate tooltip without exit from control?

Thank you

Luigi

Stenly
Telerik team
 answered on 13 Oct 2021
1 answer
196 views
Good morning everyone, I would like to know if the ImageEditor control can add a horizontal and vertical ruler, in order to be able to use it as a guide when creating images or any other content. I look forward to your kind attention.
Stenly
Telerik team
 answered on 12 Oct 2021
1 answer
215 views

I have a RadGridView inside that 2 different column i have a cell template and a datatemplate in that i have the RichTextbox inside that paragraph inside that run and the text property binded on it.

 

Now i need to compare tow richtexbox text value. If any RichTextbox value is different it need to be highlighted inside thta text Box.

XAML

                    

<RadGridView Grid.Row="1" x:Name="gfgvBrokenLinks" AutoGenerateColumns="False" ItemsSource="{Binding BrokenLinks}" IsReadOnly="True" AutoExpandGroups="False" RowLoaded="gfgvBrokenLinks_RowLoaded">

<telerik:GridViewDataColumn DataMemberBinding="{Binding Data1}"  Header="Data1" IsGroupable="False">
                        <telerik:GridViewDataColumn.CellTemplate>
                            <DataTemplate>
                                <RichTextBox x:Name="richTextBox2" MinWidth="100" IsReadOnly="True">
                                    <FlowDocument >
                                        <Paragraph>
                                            <Run Text="{Binding Data1,Mode=OneWay}"></Run>
                                        </Paragraph>
                                    </FlowDocument>
                                </RichTextBox>
                            </DataTemplate>
                        </telerik:GridViewDataColumn.CellTemplate>
                    </telerik:GridViewDataColumn>

                    <telerik:GridViewDataColumn DataMemberBinding="{Binding Data2}" Header="{my:LocString ResourceKey=HeaderData2}" IsGroupable="False" >
                        <telerik:GridViewDataColumn.CellTemplate>
                            <DataTemplate>
                                <RichTextBox x:Name="richTextBox3" MinWidth="100" IsReadOnly="True" >
                                    <FlowDocument >
                                        <Paragraph>
                                            <Run Text="{Binding Data2,Mode=OneWay}"></Run>
                                        </Paragraph>
                                    </FlowDocument>
                                </RichTextBox>
                            </DataTemplate>
                        </telerik:GridViewDataColumn.CellTemplate>
                    </telerik:GridViewDataColumn>

 

 

 

c#


private void gfgvBrokenLinks_RowLoaded"object sender, Telerik.Windows.Controls.GridView.RowLoadedEventArgs e)
{



if (e.Row.Cells.Count > 0)
{
RichTextBox rt1 = e.Row?.Cells[8]?.Content as RichTextBox;
RichTextBox rt2 = e.Row?.Cells[9]?.Content as RichTextBox;
if (rt1 != null && rt2 != null)
{
string a1 = StringFromRichTextBox(rt1);
string a2 = StringFromRichTextBox(rt2);
if (!a1.Equals(a2))
{
int startindex = 0;
startindex = a1.Zip(a2, (c1, c2) => c1 == c2).TakeWhile(b => b).Count();
int length = a2.Length - startindex;
Select(rt2, startindex, length, Colors.Yellow);
}



//string text = new TextRange(rt2.Document.ContentStart, rt2.Document.ContentEnd).Text;
//if (text.Length > 0)
//{
// TextPointer myTextPointer1 = rt2.Document.ContentStart.GetPositionAtOffset(startindex + 1);
// TextPointer myTextPointer2 = rt2.Document.ContentEnd;
// if (myTextPointer1 != null && myTextPointer2 != null)
// {
// TextRange tr = new TextRange(myTextPointer1, myTextPointer2);
// tr.ApplyPropertyValue(TextElement.BackgroundProperty, Brushes.Yellow);
// }
//}
}
}
}



private static TextPointer GetTextPointAt(TextPointer from, int pos)
{
TextPointer ret = from;
int i = 0;



while ((i < pos) && (ret != null))
{
if ((ret.GetPointerContext(LogicalDirection.Backward) == TextPointerContext.Text) || (ret.GetPointerContext(LogicalDirection.Backward) == TextPointerContext.None))
{
i++;
}



if (ret.GetPositionAtOffset(1, LogicalDirection.Forward) == null)
{
return ret;
}



ret = ret.GetPositionAtOffset(1, LogicalDirection.Forward);
}



return ret;
}



internal string Select(RichTextBox rtb, int offset, int length, Color color)
{
// Get text selection:
TextSelection textRange = rtb.Selection;



// Get text starting point:
TextPointer start = rtb.Document.ContentStart;



// Get begin and end requested:
TextPointer startPos = GetTextPointAt(start, offset);
TextPointer endPos = GetTextPointAt(start, offset + length);



// New selection of text:
textRange.Select(startPos, endPos);



// Apply property to the selection:
textRange.ApplyPropertyValue(TextElement.BackgroundProperty, new SolidColorBrush(color));



// Return selection text:
return rtb.Selection.Text;
}

private string StringFromRichTextBox(RichTextBox rtb)
{
TextRange textRange = new TextRange(rtb.Document.ContentStart, rtb.Document.ContentEnd);
return textRange.Text.Replace("\r\n", "");
}

Thanks In Advance

Dilyan Traykov
Telerik team
 answered on 12 Oct 2021
1 answer
142 views

Hi, 

I want to change the Time Button Style of RadDateTimePicker, like mouseover or pressed style.

But i cannot find it in tempalte.

Masha
Telerik team
 answered on 12 Oct 2021
1 answer
660 views

Hello.

Inside the gridview is a hierarchical gridview.

I created a button of the column cell template in the hierarchical grid view.

How to bind this button and how to receive parameters?

Upload a simple example image and source.


<telerik:RadGridView x:Name="xMain"  ItemsSource="{Binding Main}">
    <telerik:RadGridView.Columns>
        <telerik:GridViewDataColumn Header="Name"  DataMemberBinding="{Binding Name}"/>
        <telerik:GridViewColumn Header="View" Width="80" HeaderTextAlignment="Center" TextAlignment="Center">
            <telerik:GridViewColumn.CellTemplate>
                <DataTemplate>
                    <telerik:RadButton	Content="MainButton"
										Command="{Binding DataContext.OnClickCommand, RelativeSource={RelativeSource FindAncestor,AncestorType=telerik:RadGridView}}"
										CommandParameter="{Binding}">
                    </telerik:RadButton>
                </DataTemplate>
            </telerik:GridViewColumn.CellTemplate>
        </telerik:GridViewColumn>

        <telerik:RadGridView.ChildTableDefinitions>
        <telerik:GridViewTableDefinition>
            <telerik:GridViewTableDefinition.Relation>
                <telerik:PropertyRelation ParentPropertyName="Subs" />
            </telerik:GridViewTableDefinition.Relation>
        </telerik:GridViewTableDefinition>
    </telerik:RadGridView.ChildTableDefinitions>

    <telerik:RadGridView.HierarchyChildTemplate>
        <DataTemplate>
                <telerik:RadGridView x:Name="xSubs" ItemsSource="{Binding Subs}">
                <telerik:RadGridView.Columns>
                    <telerik:GridViewDataColumn Header="Name"  DataMemberBinding="{Binding Name}"/>
                    <telerik:GridViewColumn Header="View" Width="80" HeaderTextAlignment="Center" TextAlignment="Center">
                        <telerik:GridViewColumn.CellTemplate>
                            <DataTemplate>
                                <telerik:RadButton	Content="SubButton"
													Command="{Binding DataContext.OnClickCommand, RelativeSource={RelativeSource FindAncestor,AncestorType=telerik:RadGridView}}"
													CommandParameter="{Binding}">
                                </telerik:RadButton>
                            </DataTemplate>
                        </telerik:GridViewColumn.CellTemplate>
                    </telerik:GridViewColumn>
                </telerik:RadGridView.Columns>
            </telerik:RadGridView>
        </DataTemplate>
    </telerik:RadGridView.HierarchyChildTemplate>
</telerik:RadGridView>

It is bound to the same OnClickCommand and will receive an object to identify it.

(CommandParameter is the selecteditem that is bound to the GridView.)

 

MainButton working / SubButton not working

I also tried setting Mode=TemplatedParent of RelativeSource and other settings, but couldn't find a solution.

I will wait for your reply.
thank you.
Stenly
Telerik team
 answered on 12 Oct 2021
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?