Last post Jan 07, 2009 09:17 AM by luisevalencia
Jan 06, 2009 11:25 AM|luisevalencia|LINK
Hello, In all my pages of DYNAMIC DATA it happens to me.
1. CLick on edit on the gridview to pass the data to the detailsview
2. Delete a row on the gridview.
then, the detailsview disappear
Jan 06, 2009 01:56 PM|sjnaughton|LINK
What you are saying is in the Details page you click the Delete link and it goes back to the List page? If I'm correct then this is normal, what would you like to happen?
Jan 06, 2009 02:22 PM|luisevalencia|LINK
I dont use the details page, I use ListDetails only, I want everything to be done in the same page.
I dont think its normal!
Jan 06, 2009 04:57 PM|ricka6|LINK
That's the expected behavior. Once you delete a selected entity, it disappears from the details view. Do you want to set the selected index and arbitrarily display the first entity (as on Page_Load)?
Jan 07, 2009 09:17 AM|luisevalencia|LINK
It makes sense, but the detailsview disappear and now there is no option to create a new entity.
I did the following trick
Just disable the delete image on edit mode.
protected void OnGridViewSelectedIndexChanged(object sender, EventArgs e)
foreach (GridViewRow r in GridView1.Rows)
if (r.RowType == DataControlRowType.DataRow)
ImageButton img = (ImageButton)GridView1.Rows[i].Cells[GridView1.Columns.Count - 1].FindControl("ImageButton2");
img.Visible = false;