473,569 Members | 2,789 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

How to edit in GridView using asp:BoundField-Urgent pls. reply asa

Hi

I am using asp:BoundField code for my GridView Control. Something like:

<asp:GridView ID="GridView2" runat="server" AutoGenerateEdi tButton="True"
OnRowEditing="G ridView2_RowEdi ting">

<Columns>
............... .............
............... .............
<asp:BoundFie ld HeaderText="Ter m Date"
DataField="term date">
<ControlStyle Width="100px" />
</asp:BoundField>

............... ...........
............... ...........
</Columns>
</asp:GridView>
I need to edit this termdate. In the code-behind I am using the following
code for editing..

In the code-behind I am using the following code to edit the termdate:

protected void GridView2_RowUp dating(object sender,
GridViewUpdateE ventArgs e)
{
GridViewRow row = GridView2.Selec tedRow;
string enrollid = GridView2.Rows[e.RowIndex].Cells[4].Text.Trim();
updateEnrollRes triction(enroll id,
GridView2.Rows[e.RowIndex].Cells[4].Text.Trim());
}

Since my termdate column is converting to a editable textbox on Update-Click,
I am getiing the erollid as an empty string ?

Any ideas how I can make this work ?

Appreciate any help!
--
Thanks,
SDRoy
Apr 26 '06 #1
1 2966
Use e.NewValues["termdate"].

Apr 27 '06 #2

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

Similar topics

1
1754
by: John A Grandy | last post by:
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"
6
8255
by: Dabbler | last post by:
I have a dropdownlist in a GridView ItemTemplate. I need to bind the ddl to an SqlDataSource, then have a value from a boundfield in the row be passed as the keyfield for select where clause. Im trying to load the ddl with a list of dates from another table keyed on GridView row field that only apply to this row. Any suggestions would be...
2
4153
by: Romain Salad | last post by:
I must admit I probably get less help than from this newsgroup than is humanly possible, but I thought I'd try again: In some circumstances I need this: <asp:BoundField DataField="AMOUNT" HeaderText="AMOUNT" SortExpression="AMOUNT" DataFormatString="{0:$#,#.##}" HtmlEncode="False" > But when the field is empty, i want to use a...
2
2789
by: Michael | last post by:
Hi Everyone, I have a gridview control with the following markup: <asp:GridView ID="grdPOs" runat="server" AllowPaging="True" AutoGenerateColumns="False" BackColor="White" BorderColor="#CC9966" BorderStyle="None" BorderWidth="1px" CellPadding="4" DataKeyNames="ItemId" Height="68px" PageSize="5" Width="642px"> <FooterStyle...
1
1841
by: Marc | last post by:
Hi, I made a detailsview for inserting records. I also made a gridview for editing and deleting the same records. The keyfield is an autonumbering field in Access (pcnr). My problem is: I can see the new inserted records in the gridview but I can't delete or edit them. When clicking on delete or edit link, nothing happens (no error...
2
3800
by: VB Programmer | last post by:
I have a gridview control with several data fields. When the user clicks 'edit' for the row I want the user to be able to edit a particular text field. Under that 'edit' textbox is a button. When they click on the button it fills in the textbox with some standard text. Question: In the code for the button how do I reference the textbox...
2
2793
by: jMehdi | last post by:
I have the following definition: <asp:BoundField DataField="ThreadPostAuthor" HeaderText="<%$ Resources:ForumsRes, StartedBy %>" SortExpression="ThreadPostAuthor" HtmlEncode="false" /> When the UICulture is set to French the HeaderText displays encoded characters (eg: "Commencé par" instead of "Commencé par") so I've added the HtmlEncode...
2
4191
by: ronc85 | last post by:
Using ASP.NET 2.0, is there a way to replace the first 5 bytes of a GridView columns BoundField Datafield using DataFormatString e.g. change the display of an ssn value from "031121234" to "*****1234" Sal
2
11249
by: mohaaron | last post by:
Why does it seem like is impossible to set the width of a BoundField in a GridView. I've tried all sorts of different way to set the width and none of them work. So far the only thing I've done that has worked is to set the Wrap property to false which is not what I want do. Can anyone tell me now to set the column width of a GridView in the...
1
1641
by: =?Utf-8?B?R3JpZFZpZXcgTmV3Ymll?= | last post by:
Is there a way to explicitly name BoundFields in a GridView? The controls are getting names like "ctl10". There is one control that I would like to name "LocationType" so I can pass that string into FindControl() instead of the meaningless "ctl10". Thanks for the help.
0
7697
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main...
0
7612
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language...
0
7924
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, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. ...
0
8120
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...
0
7968
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...
0
6283
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...
0
5219
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...
0
3640
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
1212
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.