Thursday, July 3, 2008

Textbox's Value to Gridview's Textbox without PostBack

Have you thought of having such a Textbox which will insert values into Gridview's Textbox without performing may seems childish , but thought some might need it.

Now,Lets Hit it

1. Here you have to register an array of Tetxbox from which you want to take the value as well Textbox in grid where you want to put value.

put this code in Page_Load Event or rowdatabound event.....

after adding above code now turn for javascript:
2. Now comes the design part where you have to just assign a Tetxboxes from above code one must easily understand that which textbox is which ( ok ok dont confuse yourself...........)
this values of the texboxes for example. in javascript code txtnotes is from Gridview (which is shown into VB code) and as txtboxIds shown in javascript code is the textbox which is going to populate in the Modalpopup from AjaxcontrolToolkit.

And above modalpopup is into the gridview's column (templete column)so for each row 1 modalpopup will generate and you are just assigning the value of 1 textbox to other......

hope this helps some one.


Note: Becareful with the code,cause as it is generating the modalpopup for each row in my case i have data also in my modalpopup, so i am forced to do like that ,
sometime it happens that you will find some error from browser that Stop running the script? , cause your browser will not able to load whole javascript,for that there is work around like one can simply do the paging for this kind of scenario so browser doesn't have to load fully.

No comments: