473,847 Members | 1,709 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

config GridView so row shows in edit mode

I'm not using SqlDataSource or ObjectDataSourc e. 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="t rue"
BackColor="Aqua "

Caption="Tasks" DataKeyNames="T askID" EnableViewState ="true"
ForeColor="Blac k"

EnableSortingAn dPagingCallback s="false"

AutoGenerateDel eteButton="true " AutoGenerateEdi tButton="true"

OnRowEditing="g vTasks_RowEditi ng"
OnRowCancelingE dit="gvTasks_Ro wCancelingEdit"

OnRowUpdating=" gvTasks_RowUpda ting" OnRowUpdated="g vTasks_RowUpdat ed"

OnRowDeleting=" gvTasks_RowDele ting" OnRowDeleted="g vTasks_RowDelet ed"

OnRowCreated="g vTasks_RowCreat ed"


<Columns>

<asp:BoundFie ld DataField="Task ID" Visible="false" />

<asp:BoundFie ld DataField="Task Date" ShowHeader="tru e" HeaderText="Dat e" />

<asp:BoundFie ld DataField="Task Description" ShowHeader="tru e"
HeaderText="Des cription" />

<asp:BoundFie ld DataField="Task TimeInHours" DataFormatStrin g="0.0"
ShowHeader="tru e" HeaderText="Hou rs" />

</Columns>

</asp:GridView>
Feb 17 '06 #1
1 1774
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_RowEdi ting 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******** ******@TK2MSFTN GP10.phx.gbl...
I'm not using SqlDataSource or ObjectDataSourc e. 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="t rue"
BackColor="Aqua "

Caption="Tasks" DataKeyNames="T askID" EnableViewState ="true"
ForeColor="Blac k"

EnableSortingAn dPagingCallback s="false"

AutoGenerateDel eteButton="true " AutoGenerateEdi tButton="true"

OnRowEditing="g vTasks_RowEditi ng"
OnRowCancelingE dit="gvTasks_Ro wCancelingEdit"

OnRowUpdating=" gvTasks_RowUpda ting" OnRowUpdated="g vTasks_RowUpdat ed"

OnRowDeleting=" gvTasks_RowDele ting" OnRowDeleted="g vTasks_RowDelet ed"

OnRowCreated="g vTasks_RowCreat ed"


<Columns>

<asp:BoundFie ld DataField="Task ID" Visible="false" />

<asp:BoundFie ld DataField="Task Date" ShowHeader="tru e" HeaderText="Dat e"
/>

<asp:BoundFie ld DataField="Task Description" ShowHeader="tru e"
HeaderText="Des cription" />

<asp:BoundFie ld DataField="Task TimeInHours" DataFormatStrin g="0.0"
ShowHeader="tru e" HeaderText="Hou rs" />

</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
19269
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 programatically a dataSet, set it as a DataSource for my GridView an add it to Session. 3. I want my users to be able to edit data displayed in GridView, so I added Edit command column. 4. When user clicks Edit, then I get the following error: "The GridView
4
2074
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.) Is there a way to tell the GridView to only show certain columns if that particular row is in edit mode? I can hide the Edit and Delete buttons when entering edit mode, but when I display save and cancel buttons by enabling their rowns, not...
0
2146
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 have one save button to submit all the hours that user entered. On the backend save button clicked event, I mannually build my update statement to write the workhours into database. Also, if the workhours field is not editable(e.g the timesheet...
0
2141
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 have a gridview which displays the results of the search. if no search is entered, then the gridview shows all records. Below the gridview i have a formview for inserting and editing the records. when a user clicks on one of the records in the...
1
10411
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" OnRowCreated="ContactHistoryGrid_RowCreated" CssClass="GridViewTable" GridLines="None" CellSpacing="1" CellPadding="3" AllowSorting="True" AllowPaging="True"> <EmptyDataTemplate>
0
6504
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 write a full fledged article. I didn't like the options, such as putting your controls (really, DUPLICATING your controls) in the Footer for a variety of reasons. First, I don't like the idea of having to do things twice, including any...
4
5917
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 Textboxes with labels and I turn off the Update command because I want to write my own update command. I can not figure out how to pull the value from a cell in the row the user hit Edit on. Example: User hits edit on row 10 and the value I want to...
3
2190
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 dropdown entry from one of the rows. So, when the gridview comes up, it shows nothing in the column where I deleted it. Then when I select to edit that same row, I get an error because I cannot select the value for the dropdown for a non-existing value....
0
1020
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 Update method accepts a J as an input parameter. J has a date property.
0
10647
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 tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
10706
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
10338
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
9482
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
7882
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
7056
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
5911
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
4528
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
4119
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

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.