config GridView so row shows in edit mode

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>
 
A

Andrew Robinson

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.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,995
Messages
2,570,226
Members
46,815
Latest member
treekmostly22

Latest Threads

Top