473,407 Members | 2,598 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,407 software developers and data experts.

Need help with GridView update

Hey guys,

I'm using ASP.NET 2.0 GridView for the first time. I have the following
setup

On the .aspx side I have this in my GridView

<asp:TemplateField HeaderText="New">

<ItemTemplate>

<%# Eval("New")%>
</ItemTemplate>
<EditItemTemplate>
<asp:TextBox ID="tbxNew"
runat="server" Text='<%# Eval("New")%>'></asp:TextBox>
</EditItemTemplate>

</asp:TemplateField>

and when I .cs side I have this

protected void gvLicenseSplit_RowUpdating(object sender,
GridViewUpdateEventArgs e)
{
GridViewRow row = gvLicenseSplit.Rows[e.RowIndex];

TextBox t = (TextBox)row.FindControl("tbxNew");

Response.Write("The Text Entered is" + t.Text);
}

The value of tbxNew is always empty. Could someone please help me with
this?

Thanks
M.

Jan 25 '07 #1
2 1023
I got it. The problem was with how I was handling the postback. It was
reloading my data.

Maz.

On Jan 25, 4:27 pm, "mazdotnet" <maflat...@gmail.comwrote:
Hey guys,

I'm using ASP.NET 2.0 GridView for the first time. I have the following
setup

On the .aspx side I have this in my GridView

<asp:TemplateField HeaderText="New">

<ItemTemplate>

<%# Eval("New")%>
</ItemTemplate>
<EditItemTemplate>
<asp:TextBox ID="tbxNew"
runat="server" Text='<%# Eval("New")%>'></asp:TextBox>
</EditItemTemplate>

</asp:TemplateField>

and when I .cs side I have this

protected void gvLicenseSplit_RowUpdating(object sender,
GridViewUpdateEventArgs e)
{
GridViewRow row = gvLicenseSplit.Rows[e.RowIndex];

TextBox t = (TextBox)row.FindControl("tbxNew");

Response.Write("The Text Entered is" + t.Text);
}

The value of tbxNew is always empty. Could someone please help me with
this?

Thanks
M.
Jan 26 '07 #2
I got it. It was how I was handling the postback.
On Jan 25, 4:27 pm, "mazdotnet" <maflat...@gmail.comwrote:
Hey guys,

I'm using ASP.NET 2.0 GridView for the first time. I have the following
setup

On the .aspx side I have this in my GridView

<asp:TemplateField HeaderText="New">

<ItemTemplate>

<%# Eval("New")%>
</ItemTemplate>
<EditItemTemplate>
<asp:TextBox ID="tbxNew"
runat="server" Text='<%# Eval("New")%>'></asp:TextBox>
</EditItemTemplate>

</asp:TemplateField>

and when I .cs side I have this

protected void gvLicenseSplit_RowUpdating(object sender,
GridViewUpdateEventArgs e)
{
GridViewRow row = gvLicenseSplit.Rows[e.RowIndex];

TextBox t = (TextBox)row.FindControl("tbxNew");

Response.Write("The Text Entered is" + t.Text);
}

The value of tbxNew is always empty. Could someone please help me with
this?

Thanks
M.
Jan 26 '07 #3

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

Similar topics

4
by: Anne Catterick | last post by:
Hi, I have an british ASP.Net 2.0 application which is doing what (should) be very simple. But I am having issues. On my page I have a GridView as follows (some tags excluded for easy...
1
by: Scott F K Hooper | last post by:
VB.NET 2.0 project... I have an Access database with a table that has one primary key. I have used the Add TableAdapter wizard in VS2005 to create my TableAdapter. Next I added an ObjectDataSource...
0
by: DC | last post by:
The problem I'm using the .NET GridView and FormView objects for the first time and im getting the error "An OleDbParameter with ParameterName '@ID' is not contained by this...
3
by: pvong | last post by:
VB.NET How do you change a gridview from Update mode to normal mode? I'm usually dealing for Formviews and there is a ChangeMode option but I don't see one for Gridviews.
4
by: tim.cavins | last post by:
I have a GridView populated by an ObjectDataSource. I am having issues passing the parameters to the objectdatasource. I have verified that the method is being called but none of the parameters...
4
by: mohaaron | last post by:
This seems like it should be simple to do but for some reason I have been unable to make it work. I would like to databind a SqlDataSource to a GridView during the click event of a button. This...
11
by: SAL | last post by:
Hello, I have a Gridview control (.net 2.0) that I'm having trouble getting the Update button to fire any kind of event or preforming the update. The datatable is based on a join so I don't know...
0
by: steve | last post by:
I have been fighting with trying to update a GridView for a while. I don't want to use the "built-in" way to do it because I am using business layer methods for updating and deleteing and I don't...
4
by: BiffMaGriff | last post by:
Hello, I have a GridView that I put inside an update panel. I have a control that attaches to the datasource of the gridview that filters the data, databinds the gridview and then updates the...
5
by: sandhyascs | last post by:
Hi everyone I’m using the GridView in asp.net and populating the grid dynamically using c#.net.To edit the rows i i m using GridView1_RowUpdating(object sender, GridViewUpdateEventArgs e)....
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
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,...
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
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...
0
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...
0
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,...
0
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...

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.