Wrox Programmer Forums
|
ASP.NET 3.5 Professionals If you are an experienced ASP.NET programmer, this is the forum for your 3.5 questions. Please also see the Visual Web Developer 2008 forum.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the ASP.NET 3.5 Professionals section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old September 14th, 2011, 07:51 PM
Registered User
 
Join Date: Sep 2011
Posts: 1
Thanks: 0
Thanked 0 Times in 0 Posts
Default grid to textbox

Hi, i got a problem with aspxgridview from devxpress, i needed select one checkbox in aspxgridview, and the information that contains the row, i need copy in one textbox...thanks
 
Old October 31st, 2011, 02:47 AM
Registered User
 
Join Date: Oct 2011
Posts: 3
Thanks: 0
Thanked 0 Times in 0 Posts
Default

if you are determined to use the datagrid for that matter, cast datagrid datasource to a datatable on button click like this :
void button_click(object sender, EventArgs e)
{
DataTable dt = (DataTable)(datagrid1.DataSource);
dt.rows.Add(new object[]{TextBox1.Text});
datagrid1.DataSource = dt;
datagrid1.DataBind();
}

alternatively you can achieve that without datagrid, using JavaScript.
You can create an html table and then add new rows to it using JavaScript. At the end, you can copy the content of the html table to an input type=hidden runat=server, and then get the values from hidden field using c#, pass all the info to the dataset and save it to database using data adapter.

The first one is easier to implement but the second prevents you from post backs and unnecessary network traffic.





Similar Threads
Thread Thread Starter Forum Replies Last Post
Grid priya_anthony Beginning VB 6 1 August 17th, 2007 05:04 PM
pointing cursor from one textbox to other textbox lakshmi_annayappa ASP.NET 1.0 and 1.1 Basics 2 August 2nd, 2007 03:41 PM
Navifating thru TextBox Grid like Excel cells dhruv_d ASP.NET 1.0 and 1.1 Basics 2 March 16th, 2004 01:48 AM
Masked TextBox & formatting TextBox melvik C# 1 September 22nd, 2003 11:01 AM
grid michaelw C# 2 September 9th, 2003 02:00 PM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.