
Also, It only happens once (first time)..Any ideas...? how can i freeze grid not to collapse/uncollapse.
Look at unlicked and then clicked picture attached./
8 Answers, 1 is accepted
I have tried to reproduce your problem, but I was not able to. I tested it with the following settings:
<
telerik:RadGridView.GroupHeaderTemplate
>
<
DataTemplate
>
<
HyperlinkButton
Content
=
"{Binding Header}"
Click
=
"HyperlinkButton_Click"
/>
</
DataTemplate
>
</
telerik:RadGridView.GroupHeaderTemplate
>
private void HyperlinkButton_Click(object sender, RoutedEventArgs e)
{
HyperlinkButton hyperlinkButton = e.OriginalSource as HyperlinkButton;
GridViewGroupRow groupRow = hyperlinkButton.ParentOfType<
GridViewGroupRow
>();
if(groupRow != null)
{
//implement the custom logic.
}
}
In this case, when the Hyperlink button is clicked, nothing happens - the group is neither collapsed, nor expanded.
Regards,
Maya
the Telerik team

more closely when I click on the link
This gets called and I dont see anything in the stack trace as where is that getting called from.
private
void RadGridView1_RowLoaded(object sender, RowLoadedEventArgs e)
I have this handler because I am acheveing other task here..?
I am sending you the sample project I used for testing the issue. You may feel free to change it in the way you want and use it as a reference.
Maya
the Telerik team

I have recreated it and I can tell you exactly when it happens...
I have used your solution from yesterday ..called: DoubleClockOnRow_ColorRow
( I UPGRADED IT TO VERSION: 2010.2.924.1040)
I added the hyperlink column code which you posted on this thread.
<
telerik:RadGridView Name="playersGrid" RowLoaded="RadGridView1_RowLoaded" AutoGenerateColumns="False" ItemsSource="{Binding Players}">
<telerik:RadGridView.GroupHeaderTemplate>
<DataTemplate>
<HyperlinkButton Content="{Binding Group.Key}" Click="HyperlinkButton_Click"/>
</DataTemplate> </telerik:RadGridView.GroupHeaderTemplate>
<telerik:RadGridView.Columns>
<telerik:GridViewDataColumn DataMemberBinding="{Binding Country}"/> <telerik:GridViewDataColumn DataMemberBinding="{Binding Name}"/><telerik:GridViewDataColumn DataMemberBinding="{Binding Number}"/> <telerik:GridViewDataColumn DataMemberBinding="{Binding Position}"/> </telerik:RadGridView.Columns></telerik:RadGridView>
Now run the solution
Group it by Country.
DO NOT CLICK ON ANY OF THE HYPERLINK JUST YET.
Click on 'Do somthing 1' button at the bottom of the page: this is effectively drwaing the focus away...
Now click on any link. The first group will collapse.
It only happens when the project runs first time or (not relevant here: Page with each index change)...
Also niticed: If I tried to get the focus forcefully to the grid by doing this grid.focus() on 'Do somthing 1's click event. It collapses first group.
Please advise a work around.
I am a bit confused here. I have run the sample project attached previously, grouped the playersGrid on the Country column, clicked on the button and then on the hyperlink button. Is that the right consequence of actions ? If so, as it is expected, the groups are collapsed on their creation, so even if I click on a button or not, there are still in the same state. Am I missing something from your requirements ?
Maya
the Telerik team

Im my last post I wanted to use the word 'expand' instead of 'collapse'. I am sorry. I hope my problem makes sense now.

I have submitted the ticket =367870 as I cant send you a zipped file.
You need to run it and group it by country
then click on first hyperlink and it expands the group for no reason
ALSO,
you can run the project
group it by country
Now, click this button at the bottom left corner called "Do something 1" and it expands the grid.
i cant make it any cleraren than this. This bug has caused a huge problem in our go-live project and it is extremly urgent. Please advise ASAP.
I have tried to reproduce the issues you specified. I was not able to reproduce the first one - the one with clicking on the HyperlinkButton and opening the first group. The second one - clicking on the "Do something 1" and expanding the button - is easily reproducible. However, this is by design as when the Focus() is called for the grid, it looks for a element to focus on. Consequently, it opens up the first group so that to focus the first item.
Maya
the Telerik team