7 Answers, 1 is accepted
0
Hi hosein,
Thank you for contacting us. I am not sure that I understand correctly what exactly you want to achieve. Could you please describe in greater detail the desired behavior?
You cannot change the default template, because it does not contain a selected state. The GridViewInfo object contained in the template contains this state. You can change the current GridViewInfo object by setting the CurrentView property. Here is an example:
I hope it helps. Should you have any further questions, do not hesitate to ask.
Greetings,
Jack
the Telerik team
Thank you for contacting us. I am not sure that I understand correctly what exactly you want to achieve. Could you please describe in greater detail the desired behavior?
You cannot change the default template, because it does not contain a selected state. The GridViewInfo object contained in the template contains this state. You can change the current GridViewInfo object by setting the CurrentView property. Here is an example:
this
.radGridView1.ChildRows[0].IsExpanded =
true
;
this
.radGridView1.MasterTemplate.CurrentView = ((GridViewHierarchyRowInfo)
this
.radGridView1.ChildRows[0]).ActiveView;
this
.radGridView1.ChildRows[0].ChildRows[0].IsCurrent =
true
;
I hope it helps. Should you have any further questions, do not hesitate to ask.
Greetings,
Jack
the Telerik team
0

hosein
Top achievements
Rank 1
answered on 16 Feb 2011, 09:33 PM
Hello Jack
thanks for answer.
I have a master GridView and Five child Templates(). I want to set the third child template (for example) to show when I expand the master gridview rows. It always shows the first child template while expanding rows.
is there any way to do that?
regards
0

Richard Slade
Top achievements
Rank 2
answered on 16 Feb 2011, 09:43 PM
Hello,
As far as I know this is not possible because as Jack explained. it doesnt have a selected state. You could however change the order in which you define your relations to make the one that you want the intial (selected) tab
Richard
As far as I know this is not possible because as Jack explained. it doesnt have a selected state. You could however change the order in which you define your relations to make the one that you want the intial (selected) tab
Richard
0

hosein
Top achievements
Rank 1
answered on 19 Feb 2011, 09:51 AM
Hello Richard
I was working on it but I could not find a way to programmatically change the order of child templates.
Is there any way to do that?
that code only sets active row of a child template.(it helpful for my problem)
Thanks
I was working on it but I could not find a way to programmatically change the order of child templates.
Is there any way to do that?
that code only sets active row of a child template.(it helpful for my problem)
Thanks
0

Richard Slade
Top achievements
Rank 2
answered on 19 Feb 2011, 12:05 PM
Hello Hosein,
I believe that the way to do this would be to remove all child template and re-add them in the order that you need.
Hope you find that helpful
Richard
I believe that the way to do this would be to remove all child template and re-add them in the order that you need.
Hope you find that helpful
Richard
0
Accepted
Hello Hosein,
You can change the active tab in grid hierarchy by handling the ChildViewExpanding event. Here is a sample:
The tab order is determined by the order in which templates are stored in the Templates collection. You can change this order by using the Move method. Consider the following code:
I hope this helps. If you have any other questions, do not hesitate to contact us.
All the best,
Jack
the Telerik team
You can change the active tab in grid hierarchy by handling the ChildViewExpanding event. Here is a sample:
void
radGridView1_ChildViewExpanding(
object
sender, ChildViewExpandingEventArgs e)
{
if
(!e.IsExpanded)
{
e.ParentRow.ActiveView = e.ParentRow.Views[1];
}
}
The tab order is determined by the order in which templates are stored in the Templates collection. You can change this order by using the Move method. Consider the following code:
this
.radGridView1.Templates.Move(0, 1);
I hope this helps. If you have any other questions, do not hesitate to contact us.
All the best,
Jack
the Telerik team
0

hosein
Top achievements
Rank 1
answered on 23 Feb 2011, 03:25 PM
Hello jack
thank you for answer
that's what I was looking for.
thanks a lot.