or
private void InitPvProductCategoryTree()
{
ProductDAO proDao = new ProductDAO();
List<ProductCategory> categorys = proDao.GetAllCategoryList("");
tbxCategroy.DisplayMember = "CategoryName";
this.tbxCategroy.ValueMember = "ProductCategoryID";
this.tbxCategroy.ParentIDMember = "ParentID";
this.tbxCategroy.DataSource = categorys;
// this.tbxCategroy.DataMember = "Nodes";
}
private
string
ConvertDataToString(
bool
onlySelectedRows)
{
StringBuilder sbTextData =
new
StringBuilder();
// Copy columns header
foreach
(GridViewColumn col
in
this
.radGridView.Columns)
{
sbTextData.Append(col.HeaderText.Replace(
"\n"
,
" "
) +
"\t"
);
}
sbTextData.Append(
"\n"
);
// Convert only selected rows
if
(onlySelectedRows)
{
foreach
(GridViewRowInfo row
in
this
.radGridView.SelectedRows)
{
int
i = 0;
while
(i < row.Cells.Count)
{
if
(i > 0)
{
sbTextData.Append(
"\t"
);
}
if
(row.Cells[i].ColumnInfo
is
GridViewComboBoxColumn)
{
// Obtain displayed data
}
else
if
(row.Cells[i].Value ==
null
)
{
sbTextData.Append(
string
.Empty);
}
else
{
sbTextData.Append(row.Cells[i].Value.ToString());
}
i++;
}
sbTextData.Append(
"\n"
);
}
}
else
{
foreach
(GridViewRowInfo row
in
this
.radGridView.Rows)
{
int
i = 0;
while
(i < row.Cells.Count)
{
if
(i > 0)
{
sbTextData.Append(
"\t"
);
}
if
(row.Cells[i].Value ==
null
)
{
sbTextData.Append(
string
.Empty);
}
else
{
sbTextData.Append(row.Cells[i].Value.ToString());
}
i++;
}
sbTextData.Append(
"\n"
);
}
}
return
sbTextData.ToString();
}
I have a hierarchic GridView and I want to scroll to the selected row after a new databind of the control.
If I do
this.radGridView1.TableElement.ScrollToRow(this.radGridView1.CurrentRow);
no problem if the current row is a parent row but if the current row is a child row the GridView scroll to the end.
How to scroll to a selected child row?
Thanks