D
dan
Hi,
I have a hard time finding an example with GridView and FormView on the same
page. So I'm hoping that someone will be able to help me with the following:
1) How do I refresh GridView after Insert, Update, and Delete in a linked
FormView?
That is, I'd like the GridView to show updates made to a row, show a newly
added row, and remove a deleted row.
2) How do I force the FormView to display in InsertMode if no items are
present in the associated GridView?
I know that I need to call ChangeMode() on the FormView but I'm not sure
where. I tried Selected event of the associated ObjectDataSource with "if
(e.RowsAffected < 1) FormView.ChangeMode(FormViewMode.Insert)" but this
does not seem to work. The ObjectDataSourceStatusEventArgs.RowsAffected is
always -1 regardless of how many rows are displayed in the GridView. So I
must be checking it in the wrong place.
Any help will be greatly appreciated.
Thanks,
I have a hard time finding an example with GridView and FormView on the same
page. So I'm hoping that someone will be able to help me with the following:
1) How do I refresh GridView after Insert, Update, and Delete in a linked
FormView?
That is, I'd like the GridView to show updates made to a row, show a newly
added row, and remove a deleted row.
2) How do I force the FormView to display in InsertMode if no items are
present in the associated GridView?
I know that I need to call ChangeMode() on the FormView but I'm not sure
where. I tried Selected event of the associated ObjectDataSource with "if
(e.RowsAffected < 1) FormView.ChangeMode(FormViewMode.Insert)" but this
does not seem to work. The ObjectDataSourceStatusEventArgs.RowsAffected is
always -1 regardless of how many rows are displayed in the GridView. So I
must be checking it in the wrong place.
Any help will be greatly appreciated.
Thanks,