473,386 Members | 1,745 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,386 software developers and data experts.

config GridView so row shows in edit mode

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>
Feb 17 '06 #1
1 1746
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.

--

Andrew Robinson
http://blog.binaryocean.com
"John A Grandy" <johnagrandy-at-yahoo-dot-com> wrote in message
news:eM**************@TK2MSFTNGP10.phx.gbl...
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>

Feb 17 '06 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

3
by: misiek | last post by:
Hi all. I have following problem: 1. In my web page I have a GridView control, which does not have a DataSourceId set in designer. 2. When user presses Start button then I create...
4
by: | last post by:
I wanted better control over the display of the command buttons, so I created Template columns for each command. (Otherwise the GridView was putting extras spacing around the images and such.) ...
0
by: rockdale | last post by:
Hi, I have a web page which let user data enter employee working hours. I used datagrid to list all the employee and templateColumn to format the workhours column to textbox for data entry. And...
0
by: LiamLiamLiam | last post by:
G'day all. I having a problem with my formview. I'll ty to explain my situation as best as i can. I have a page with a search field at the top which is just a simple asp:textbox. Below that i...
1
by: Evan M. | last post by:
Here's my GridView and my SqlDataSource <asp:GridView ID="ContactHistoryGrid" runat="server" AutoGenerateColumns="False" DataSourceID="ContactHistoryDS" DataKeyNames="JobHistoryID"...
0
by: Larry Bud | last post by:
After spending two days looking at the options in adding a row to a gridview, I came up with my own that I'd like to share. I only can share pseudo-code right now, but maybe in the future I'll...
4
by: pvong | last post by:
Hi, I'm a newbie and I'm looking for some help. I'm programming in VB.Net. I have a simple gridview and when the user hits the Edit link, the gridview changes to edit mode. I replaced the...
3
by: =?Utf-8?B?V2FubmFiZQ==?= | last post by:
I have a gridview that uses a sqldatasource. The rows of the gridview are editable. When the gridview is in edit mode, one of the columns is a dropdown. In testing the editing, I deleted the...
0
by: bob | last post by:
Hi, Asp Net 2.0 VS2008. GridView being fed by an ObjectDatasource. ObjectDataSource is bound to DataAccess Class. The DAL Select method returns a IEnumerable<Jto the ObjectDataSource. The...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.