8 Answers, 1 is accepted
0
Hello Sam Ur,
Maya
the Telerik team
You may try to use the IsExpandedChanged event of the GridViewRow.
Maya
the Telerik team
Do you want to have your say when we set our development plans?
Do you want to know when a feature you care about is added or when a bug fixed?
Explore the
Telerik Public Issue Tracking
system and vote to affect the priority of the items
0

Sam Ur
Top achievements
Rank 2
answered on 06 Sep 2010, 01:49 PM
Hi,
sorry for the late reply. I tried to use event you suggested but it's not working as i hoped.
I still have to first select a row and then click toggle button to see the changes i want.
sorry for the late reply. I tried to use event you suggested but it's not working as i hoped.
I still have to first select a row and then click toggle button to see the changes i want.
0
Hi Sam Ur,
You have three options:
1. You can attach to the RowDetailsVisibilityChanged event of RadGridView. For more information, please consult the docs.
2. You can inherit from GridViewToggleRowDetailsColumn and override its CreateCellElement. Call the base implementation and it will return the toggle button. Attach to its Click event and return it.
3. Alternatively, you can create your very own toggle column and have full control over what is going on. This is demonstrated in my blog post.
I hope this helps.
All the best,
Ross
the Telerik team
You have three options:
1. You can attach to the RowDetailsVisibilityChanged event of RadGridView. For more information, please consult the docs.
2. You can inherit from GridViewToggleRowDetailsColumn and override its CreateCellElement. Call the base implementation and it will return the toggle button. Attach to its Click event and return it.
3. Alternatively, you can create your very own toggle column and have full control over what is going on. This is demonstrated in my blog post.
I hope this helps.
All the best,
Ross
the Telerik team
Do you want to have your say when we set our development plans?
Do you want to know when a feature you care about is added or when a bug fixed?
Explore the
Telerik Public Issue Tracking
system and vote to affect the priority of the items
0

Sam Ur
Top achievements
Rank 2
answered on 06 Sep 2010, 07:33 PM
Hi Ross,
I created another class:
But i don't know...now i cannot get details rows to show on my main grid...I also changed code in my xaml...
I don't know where I'm stuck.
I created another class:
class MyToggleButton:GridViewToggleRowDetailsColumn
{
public GridViewCell cell { get; set; }
public object dataItem { get; set; }
public MyToggleButton()
{
this.ExpandMode = GridViewToggleRowDetailsColumnExpandMode.Single;
}
public override FrameworkElement CreateCellElement(GridViewCell cell, object dataItem)
{
this.cell = cell;
this.dataItem = dataItem;
GridViewToggleButton gwtb = new GridViewToggleButton()
{
Command = RadGridViewCommands.ExpandHierarchyItem,
CommandParameter = dataItem
};
return gwtb;
}
void gwtb_Click(object sender, RoutedEventArgs e)
{
}
}
...
<
my:MyToggleButton
x:Name
=
"toggleButton"
/>
0
Accepted
Hi Sam Ur,
Please, use one of the other two approaches then.
Kind regards,
Ross
the Telerik team
Please, use one of the other two approaches then.
Kind regards,
Ross
the Telerik team
Do you want to have your say when we set our development plans?
Do you want to know when a feature you care about is added or when a bug fixed?
Explore the
Telerik Public Issue Tracking
system and vote to affect the priority of the items
0

Sam Ur
Top achievements
Rank 2
answered on 07 Sep 2010, 08:28 PM
Thank you Ross,
basically i went into completely different way - hierarchy templates did the trick...sorry to bodder you but again
thank you for your help!
basically i went into completely different way - hierarchy templates did the trick...sorry to bodder you but again
thank you for your help!
0

kedarnath
Top achievements
Rank 1
answered on 19 May 2011, 01:37 PM
Dear Sam ur
I hope u got the solution for handling the row detail toggle button click event...
Could u please post that code....
I have been searching for the same.....
Thanx in advance...
I hope u got the solution for handling the row detail toggle button click event...
Could u please post that code....
I have been searching for the same.....
Thanx in advance...
0

Sam Ur
Top achievements
Rank 2
answered on 03 Jun 2011, 02:18 PM
Hi sorry for such a later reply...but like i said i used hierarchy template to solve my issue.
But basically i used ButtonBase.Click Routed event and then in code behind wrote something like that...
Well hope it helped...at least a bit.
<
telerik:RadGridView
Name
=
"myGrid"
ButtonBase.Click
=
"myGrid_Click"
IsReadOnly
=
"True"
Grid.Row
=
"1"
RowDetailsVisibilityMode
=
"Collapsed"
ItemsSource
=
"{Binding Source={StaticResource DataSource}, Path=myData}"
DataLoadMode
=
"Synchronous"
SelectionMode
=
"Extended"
ShowGroupPanel
=
"False"
HorizontalAlignment
=
"Left"
Margin
=
"15,12,0,0"
VerticalAlignment
=
"Top"
Height
=
"638"
Width
=
"996"
AutoGenerateColumns
=
"False"
>
<
telerik:RadGridView.Columns
>
<
telerik:GridViewToggleRowDetailsColumn
/>
<
telerik:GridViewSelectColumn
Name
=
"grdCheckBox"
/>
<
telerik:GridViewDataColumn
DataMemberBinding
=
"{Binding Path=Title}"
UniqueName
=
"Title"
Header
=
"Title"
/>
</
telerik:RadGridView.Columns
>
<
telerik:RadGridView.RowDetailsTemplate
>
<
DataTemplate
>
<
Grid
>
<
Grid.RowDefinitions
>
<
RowDefinition
/>
</
Grid.RowDefinitions
>
<
Grid.ColumnDefinitions
>
<
ColumnDefinition
Width
=
"150"
/>
<
ColumnDefinition
/>
</
Grid.ColumnDefinitions
>
<
TextBlock
Text
=
"Page:"
/>
<
TextBlock
Text
=
"{Binding Path=WebURL}"
/>
</
Grid
>
</
DataTemplate
>
</
telerik:RadGridView.RowDetailsTemplate
>
</
telerik:RadGridView
>
But basically i used ButtonBase.Click Routed event and then in code behind wrote something like that...
private void grdKontakti_Click(object sender, RoutedEventArgs e)
{
if (e.OriginalSource.GetType() == new GridViewToggleButton().GetType())
{
//your code to handle togglebutton click...
}
}
Well hope it helped...at least a bit.