Forum guidelines
  • Home
  • »
  • C# Language
  • »
  • Retrieve Data when select row in gridview show in textbox
AuthorQuestion
Retrieve Data when select row in gridview show in textbox
Posted on: 27 Apr 2009
Hi all
Can help me about code to
Retrieve data when select row in gridview show in textbox.
i want to do, when select row in gridview, all data show in text through by ID.
thank advance.

HI, I want to learn more about C#
AuthorReply
Haddy
  • 0
  • 0
accepted
Re: Retrieve Data when select row in gridview show in textbox
Posted on: 17 Aug 2009   Accepted Answer
I'm surprised this was not answered, as I was searching for something else, came across this....

Not too hard to fill a textbox with a selected row index:

string selectedItemText = MyGridView.SelectedRow.Cells[1].Text; // replace 1 with whatever column u want

MyTextbox.Text = selectedItemText;


Kaplan University Student - BS Software Development
Private and Public Web Developer
Re: Retrieve Data when select row in gridview show in textbox
Posted on: 27 Apr 2009  

dude.

i think ur requirement is while selecting a particular row in datagrid.u need the details of that row in a textbox.

One method is using javascript method there is no sever side coding.I amnot sure.its possible through this.

Another common method is adding edittempalatecolumn in the grid.U can add this in the aspx page of ur form.

inside daagrid.

And in the properties window of ur datagrid u can choose editedindexchanged event. and can do ur codes.


Re: Retrieve Data when select row in gridview show in textbox
Posted on: 28 Apr 2009  
Yes it is right,
But I not want to use javascript .
because when it show in textbox. we can edit it


HI, I want to learn more about C#
Re: Retrieve Data when select row in gridview show in textbox
Posted on: 28 Apr 2009  

Thanks,

glad to know u got ur answer.


Re: Retrieve Data when select row in gridview show in textbox
Posted on: 10 Aug 2009  

can you please share your solution??
I need to do almost the samething, to show gridview column in textbox!!
 
Thanks

SPONSORED BY

Custom Software Development
MCN is your source for developing solutions involving websites, mobile apps, cloud-computing, databases, BI, back-end services and processes and client-server applications.