config GridView so row shows in edit mode

  • Thread starter Thread starter John A Grandy
  • Start date Start date
J

John A Grandy

I'm not using SqlDataSource or ObjectDataSource. I'm handling events ,
similar to approach commonly used in 1.1. DataGrid.

My question is : How do I configure a GridView's edit mode row format ?

Here is my aspx :

<asp:GridView ID="gvTasks" runat="server" AllowSorting="true"
BackColor="Aqua"

Caption="Tasks" DataKeyNames="TaskID" EnableViewState="true"
ForeColor="Black"

EnableSortingAndPagingCallbacks="false"

AutoGenerateDeleteButton="true" AutoGenerateEditButton="true"

OnRowEditing="gvTasks_RowEditing"
OnRowCancelingEdit="gvTasks_RowCancelingEdit"

OnRowUpdating="gvTasks_RowUpdating" OnRowUpdated="gvTasks_RowUpdated"

OnRowDeleting="gvTasks_RowDeleting" OnRowDeleted="gvTasks_RowDeleted"

OnRowCreated="gvTasks_RowCreated"

<Columns>

<asp:BoundField DataField="TaskID" Visible="false" />

<asp:BoundField DataField="TaskDate" ShowHeader="true" HeaderText="Date" />

<asp:BoundField DataField="TaskDescription" ShowHeader="true"
HeaderText="Description" />

<asp:BoundField DataField="TaskTimeInHours" DataFormatString="0.0"
ShowHeader="true" HeaderText="Hours" />

</Columns>

</asp:GridView>
 
John,

Not exactly clear on what you mean by Edit Mode Row Format?

If you are not using a Sql Data Source or and ODS, you need to manually bind
a dataTable or collection to the GridView. To put the grid into Edit mode,
set the EditIndex to the row you want to edit and rebind the control. This
is typically done in the GridView_RowEditing even using the NewEditIndex
event argument.

If you are looking for something else, please provide a bit more info.

Hope this is of some help.
 
Back
Top