textbox to grid

Please support our ASP.NET advertiser: Intel Parallel Studio Home
Reply

Join Date: Feb 2008
Posts: 1
Reputation: rakeshpatil1234 is an unknown quantity at this point 
Solved Threads: 0
rakeshpatil1234 rakeshpatil1234 is offline Offline
Newbie Poster

textbox to grid

 
0
  #1
Feb 16th, 2008
i have a textbox,button and datagrid
i want to add textbox value in grid on button click(with out database)
and finaly store this grid data in database(mySql)

i want to add multiple value from textbox to grid?

plz help
Reply With Quote Quick reply to this message  
Join Date: Jan 2008
Posts: 2,052
Reputation: serkan sendur is a glorious beacon of light serkan sendur is a glorious beacon of light serkan sendur is a glorious beacon of light serkan sendur is a glorious beacon of light serkan sendur is a glorious beacon of light serkan sendur is a glorious beacon of light 
Solved Threads: 118
Featured Poster
serkan sendur serkan sendur is offline Offline
Postaholic

Re: textbox to grid

 
0
  #2
Feb 16th, 2008
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 dataadapter.

The first one is more easy to implement but the second prevents you from postbacks and unneccessary network traffic.
Due to lack of freedom of speech, i no longer post on this website.
Reply With Quote Quick reply to this message  
Join Date: Dec 2008
Posts: 1
Reputation: diananizam is an unknown quantity at this point 
Solved Threads: 0
diananizam diananizam is offline Offline
Newbie Poster

Print multiple value from text box

 
0
  #3
Dec 16th, 2008
Hi,

I am very need ur help..
I have multiple text box which is the user will key in the value.
There are 1 button "Print".
Can I know what code for Print button function to print out all the text box values.

Thanks for your help..
Reply With Quote Quick reply to this message  
Reply

This thread is more than three months old.
Perhaps start a new thread instead?
Message:


Thread Tools Search this Thread



About Us | Contact Us | Advertise | DaniWeb | Acceptable Use Policy | RSS Feed

©2003 - 2009 DaniWeb® LLC