0

How can we programmatically take a GridView-row into Edit-mode using an Edit Command?

Suppose I want to edit the name of the course 'C++'.

How can I do that?

alt text

Also see this

2
  • JMSA, I would like to politely suggest that you try searching the documentation before posting your questions. I notice that you ask a lot of questions that are already very richly documented. msdn.microsoft.com/en-us/library/ms972948.aspx Commented Aug 19, 2009 at 18:05
  • Can you see the word 'Programmatically'? Commented Aug 19, 2009 at 18:09

1 Answer 1

1

In the event handler:

gridView.EditIndex = e.NewEditIndex;
gridView.DataBind();

Is that what you're looking for?

Sign up to request clarification or add additional context in comments.

1 Comment

protected void GridView1_RowEditing(object sender, GridViewEditEventArgs e) { GridView1.EditIndex = e.Item.ItemIndex;//no property named Item GridView1.DataBind(); } e don't have Item property.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.