How can I manually scroll to a row at the bottom of the datagrid? I am using 9.2v, after adding a row manually through a button, I would like to scroll to that row in the datagrid. Right now it keeps adding at the bottom and I have to manually scroll to the bottom to see that newly added row. What event can I trap to do so? Any help is appreciated. Thanks.
Yes, That did the trick. Thanks Alex.
Ok, I see the problem. The records has not yet been initialized. In this case, you can use something like this to ensure that you scroll to the bottom:
xamDataGrid1.ScrollInfo.SetVerticalOffset(double.MaxValue);
or this:
xamDataGrid1.ExecuteCommand(DataPresenterCommands.RecordLastOverall);
Thanks Alex, But I do need more help of like example how to do that, because when I tried the following, my view is just hanging...
private void AttachmentsDataGrid_InitializeRecord(object sender, InitializeRecordEventArgs e)
{
this.AttachmentsDataGrid.BringRecordIntoView(e.Record);
}
Hello,
You can use the InitializeRecord event. In order to bring a record into view, you can call the BringRecordIntoView method of the XamDataGrid.