3 Answers, 1 is accepted
0
Hi Anumeha,
Greetings,
Julian Benkov
the Telerik team
You can use following sample code snippet for your scenario:
private
void
radButton1_Click(
object
sender, EventArgs e)
{
if
(
this
.radGridView1.ChildRows.Count > 0)
{
this
.radGridView1.ChildRows[0].IsExpanded =
true
;
GridViewHierarchyRowInfo row =
this
.radGridView1.ChildRows[0]
as
GridViewHierarchyRowInfo;
if
(row !=
null
)
{
this
.radGridView1.CurrentRow = row.ActiveView.TableAddNewRow;
this
.radGridView1.CurrentColumn = row.ActiveView.ViewTemplate.Columns[0];
}
}
}
Greetings,
Julian Benkov
the Telerik team
Registration for Q1 2011 What’s New Webinar Week is now open. Mark your calendar for the week starting March 21st and book your seat for a walk through all the exciting stuff we ship with the new release!
0
Ovais
Top achievements
Rank 1
answered on 04 Oct 2011, 07:03 AM
Hello Julian,
I have a hierarchical grid, the parent row of which is user input and I fill the child rows dynamically through a datasource. The problem is on UserAddedRow event I am unable to focus the child row's first column. I have used the code snippet you provided but it doesn't seem to work. Here is the code which I am using :
I have a hierarchical grid, the parent row of which is user input and I fill the child rows dynamically through a datasource. The problem is on UserAddedRow event I am unable to focus the child row's first column. I have used the code snippet you provided but it doesn't seem to work. Here is the code which I am using :
foreach
(GridViewColumn column
in
gvStockDetail.Relations[0].ChildTemplate.Columns)
{
if
(column.IsVisible && !column.ReadOnly)
{
gvStockDetail.Relations[0].ChildTemplate.CurrentColumn = column;
break
;
}
}
0
Hello Ovais,
I hope this helps. Let me know if you need further assistance.
Kind regards,
Julian Benkov
the Telerik team
For this behavior you can use the CurrentColumn and the CurrentRow properties of RadGridView control.
foreach
(GridViewColumn column
in
gvStockDetail.Relations[0].ChildTemplate.Columns)
{
if
(column.IsVisible && !column.ReadOnly)
{
gvStockDetail.CurrentColumn = column;
break
;
}
}
I hope this helps. Let me know if you need further assistance.
Kind regards,
Julian Benkov
the Telerik team
Explore the entire Telerik portfolio by downloading the Ultimate Collection trial package. Get it now >>