hii...
:-/
can u plz get me out of the problem..!!!!1
m using visual studio 2005.
whenever i click an update button to update values of a particular column of a gridview, all the columns gets updated with the same values.
eg. if the 2nd column of 1st row with s.no. 1 is updated with values watch,50.,,,rest of the 2nd columns of rows with s.no.2,3,4,5 etc. also gets updated with these same values.

m using----

cmd.Parameters["s_no"].Value = ItemsGrid.DataKeys[(int)e.Item.ItemIndex];
       
 cmd.Parameters["@s_no"].Value = ((TextBox)e.Item.Cells[0].Controls[0]).Text;

        cmd.Parameters["@type"].Value = ((TextBox)e.Item.Cells[1].Controls[1]).Text;

        cmd.Parameters["@item"].Value = ((TextBox)e.Item.Cells[2].Controls[1]).Text;

Recommended Answers

All 8 Replies

Welcome to daniweb! Please use code tags when posting code:

[code=csharp] ...code here...

[/code]

What event is the code you posted firing off in? You probably want to access the underlying datarow and not try to access the cell's repository editor.

hii...
:-/
can u plz get me out of the problem..!!!!1
m using visual studio 2005.
whenever i click an update button to update values of a particular column of a gridview, all the columns gets updated with the same values.
eg. if the 2nd column of 1st row with s.no. 1 is updated with values watch,50.,,,rest of the 2nd columns of rows with s.no.2,3,4,5 etc. also gets updated with these same values.

m using----

cmd.Parameters["s_no"].Value = ItemsGrid.DataKeys[(int)e.Item.ItemIndex];

cmd.Parameters["@s_no"].Value = ((TextBox)e.Item.Cells[0].Controls[0]).Text;

cmd.Parameters["@type"].Value = ((TextBox)e.Item.Cells[1].Controls[1]).Text;

cmd.Parameters["@item"].Value = ((TextBox)e.Item.Cells[2].Controls[1]).Text;

Hi Megha.Jain08! I see you found your way in here and got it posted--good! Sknake is an awesome programmer and gives excellent help.

Would you mind posting more of your code? It is not hard to see why you are getting all rows' column populated with the same values, but without seeing more of your code it is difficult to know how to guide you.

Cheers!

Upload your project in a zip file. FYI it is against the forum rules to ask the same question in two different forums. Please do not do that in the future.

Upload your project in a zip file. FYI it is against the forum rules to ask the same question in two different forums. Please do not do that in the future.

Scott, I gave suggestion to move this to ASP.NET. Personally, I've never moved a thread to a different forum and I didn't provide exact instructions. Please help this person in the other thread (ASP.NET) and I will ask that this one be closed--thanks.

OK, I guess I am going crazy because now I cannot find the more detailed thread this person posted in the ASP.NET forum per my suggestion, though it was there a while ago.... whatever.

Scott, I gave suggestion to move this to ASP.NET. Personally, I've never moved a thread to a different forum and I didn't provide exact instructions. Please help this person in the other thread (ASP.NET) and I will ask that this one be closed--thanks.

I'm a little perturbed about how this happened--can someone explain it to me?

OK, I guess I am going crazy because now I cannot find the more detailed thread this person posted in the ASP.NET forum per my suggestion, though it was there a while ago.... whatever.

He opened up two questions in two forums so the moderators probably deleted the other thread. Deleted threads on daniweb are "soft deletes" so the information can still be recovered I believe.

This is the risk you run for double posting a question i'm afraid :( We can still get this issue solved however.

megha.jain: zip and upload your project if you would.

Exactly that - the other thread was deleted of the two as it had no replies while this one had replies. ASP thread now restored. Apologies for the confusion which double posts often lead to.

He opened up two questions in two forums so the moderators probably deleted the other thread. Deleted threads on daniweb are "soft deletes" so the information can still be recovered I believe.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.