473,386 Members | 1,864 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.

DataGrid Nightmare

I am trying to use the in place edit in Datagrid, however, I am experiencing
a problem which probably has a simple solutions so I thought I would ask you
guys.

I have a Grid bound to a DataSet table which works OK, I have an Edit column
in which the Edit links appear. In the Edit Event, I change the Grids
EditIndex Prperty to the row which I click using the e.item.editindex
property. OK

Now I have some text boxes in the row I want to edit. So lets say my text is
"Of all the fishes". I change the text to just "Fishes" and hit the update
button.

The update event fires , but the text returned is the original text not the
new text. I use Ctype(e.item.cells(4).Controls(0).text,textbox).te xt
In my page load, I have something like this.

If Not Postback then
get the dataset and then save it to session

Else

get it from session

End If

datagrid1.datasource = mydataset
databind.
Any ideas ?????/


--
Best Regards

The Inimitable Mr Newbie º¿º
Nov 25 '05 #1
2 1047
Dont worry, I fixed it. I realised that binding it in the load event seems
to throw away any viewstate changes. I bound it in the pre-render event and
that seems to be OK

--
Best Regards

The Inimitable Mr Newbie º¿º
"Mr Newbie" <he**@now.com> wrote in message
news:uq**************@TK2MSFTNGP11.phx.gbl...
I am trying to use the in place edit in Datagrid, however, I am
experiencing a problem which probably has a simple solutions so I thought I
would ask you guys.

I have a Grid bound to a DataSet table which works OK, I have an Edit
column in which the Edit links appear. In the Edit Event, I change the
Grids EditIndex Prperty to the row which I click using the
e.item.editindex property. OK

Now I have some text boxes in the row I want to edit. So lets say my text
is "Of all the fishes". I change the text to just "Fishes" and hit the
update button.

The update event fires , but the text returned is the original text not
the new text. I use Ctype(e.item.cells(4).Controls(0).text,textbox).te xt
In my page load, I have something like this.

If Not Postback then
get the dataset and then save it to session

Else

get it from session

End If

datagrid1.datasource = mydataset
databind.
Any ideas ?????/


--
Best Regards

The Inimitable Mr Newbie º¿º

Nov 25 '05 #2
When the update occurs, are the values being saved to the dataset in the
session variable as well?
--------------------------------------------------------------------------------
All that glitters has a high refractive index.
www.mendhak.com
"Mr Newbie" <he**@now.com> wrote in message
news:uq**************@TK2MSFTNGP11.phx.gbl...
I am trying to use the in place edit in Datagrid, however, I am
experiencing a problem which probably has a simple solutions so I thought I
would ask you guys.

I have a Grid bound to a DataSet table which works OK, I have an Edit
column in which the Edit links appear. In the Edit Event, I change the
Grids EditIndex Prperty to the row which I click using the
e.item.editindex property. OK

Now I have some text boxes in the row I want to edit. So lets say my text
is "Of all the fishes". I change the text to just "Fishes" and hit the
update button.

The update event fires , but the text returned is the original text not
the new text. I use Ctype(e.item.cells(4).Controls(0).text,textbox).te xt
In my page load, I have something like this.

If Not Postback then
get the dataset and then save it to session

Else

get it from session

End If

datagrid1.datasource = mydataset
databind.
Any ideas ?????/


--
Best Regards

The Inimitable Mr Newbie º¿º

Nov 25 '05 #3

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

Similar topics

1
by: Arno | last post by:
Hi I am using a dataset to populate a editable datagrid. When I apply a table style however, the datagrid seems to become read-only... How can I make the datagrid editable again? Is there a method...
6
by: Herve MAILLARD | last post by:
Hi, What is the best (free) datagrid for .NET ? Thanks, H. MAILLARD.
2
by: bob | last post by:
I thought I saw this somewhere, but I want to have a dropdownlist in a datagrid. I have the column as an Item template, but when I paste in the code for a dropdown list funky things seem to...
4
by: Dave | last post by:
Hello All, I am having a nightmare trying to add a new row to my Datagrid. When I use the code below I get the error: 'Invalid CurrentPageIndex value. It must be >= 0 and < the PageCount. Can...
6
by: Jim Mirra | last post by:
Hey, I have been working on this for a while now and I keep getting the same error. here is my code: ------- start code --------- Dim strSQL = "Select tagid,itemid,description,status,...
4
by: Steve | last post by:
I am fairly new to VB.NET, and I am rewriting an application I wrote a while back, also in VB.NET. I aplied some new things I learned. Anyway, here is my problem....... I have a custom DataGrid...
13
by: pmcguire | last post by:
I have a DataGrid control for which I have also created several new extended DataGridColumnStyles. They behave pretty nicely, but I can't figure out how to implement Selected Item formatting for...
2
by: Mike | last post by:
Hi, I'm having a nightmare finding any code examples that show how to add a buttoncolumn into a datagrid for a win form programatically. The only examples I can find are for asp / webforms or...
3
by: rex64 | last post by:
I created a datagrid and it worked great in the regular C#. But when I do the exact same thing in ASP it does not work. private void btnSignUp_Click(object sender, System.EventArgs e) { string...
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: 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
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: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
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:
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...
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.