Hello,
I'm using LLBLGenProDataSource with FormView to insert/edit/delete/view data. I've enabled paging on my FormView. The default behavior of FormView is that when a new record is inserted, it is not shown if there is already a record in the table.
I'm aware that I can use the PageIndex property of FormView to set the page to the newly inserted record. Example.
protected void frmvDependentChildren_ItemInserted(object sender, FormViewInsertedEventArgs e)
{
if (e.AffectedRows == 1)
{
frmvDependentChildren.PageIndex = Convert.ToInt32(frmvDependentChildren.DataKey.Value.ToString());
}
}
But this result in a Null exception error. I could 'cheat' by setting PageIndex to some large magic number like 999999 and it will work.
Can I get LLBLGenProDataSource to return the Identity of the inserted record?
Thanks.