Hi there,
I have a grid which is used for data entry and uses the New Row button.
I have set MasterTemplate.AddNewBoundRowBeforeEdit set to true so that the data is ready to be saved to the database on every cellEndEdit.
It looks like the new row still is not added to the data source until you leave that row by pressing up or down.
I need the new row added to the data source on the very first CellEndEdit. I need this because i have other controls on the form which react to rows being added.
I can use a SendKeys hack to achieve the desired result:
with this code i can edit a cell, press tab, and i end up on the next cell and the new row button appears below the current row.
Do you know of a better way to produce the same result ?
I've tried GridNavigator.SelectPreviousRow(1) in both CellEndEdit and CellValueChanged and it does nothing.
Thanks,
Matt
I have a grid which is used for data entry and uses the New Row button.
I have set MasterTemplate.AddNewBoundRowBeforeEdit set to true so that the data is ready to be saved to the database on every cellEndEdit.
It looks like the new row still is not added to the data source until you leave that row by pressing up or down.
I need the new row added to the data source on the very first CellEndEdit. I need this because i have other controls on the form which react to rows being added.
I can use a SendKeys hack to achieve the desired result:
protected
void
CellEndEdit(
object
sender, GridViewCellEventArgs e)
{
Save(e.Row.DataBoundItem);
if
(e.Row
is
GridViewNewRowInfo)
{
Debug.WriteLine(
"Attempting refresh"
);
SendKeys.Send(
"{UP}"
);
}
}
with this code i can edit a cell, press tab, and i end up on the next cell and the new row button appears below the current row.
Do you know of a better way to produce the same result ?
I've tried GridNavigator.SelectPreviousRow(1) in both CellEndEdit and CellValueChanged and it does nothing.
Thanks,
Matt