2014年7月13日 星期日

[RESOLVED] Edit in gridview


is it possible that if i click edit in gridview i get those values in the corresponding textboxes and when i click save  it updates it in the gridview.



it allows you to edit in gridview only.. 


i want to edit using textboxes.




i think this is what you want,



  1. user selects the data from grid-view to edit.
  2. selected data loaded in Edit-forms (textboxes not the grid edit-template)
  3. after edit user presses the save button, all the data is saved in db
  4. and grid-view is binded with the updated data form db

if this is what you want then just following the steps above, it is quite simple



You understood it correctly...


Please help me with following those points.....





akkibansal


is it possible that if i click edit in gridview i get those values in the corresponding textboxes and when i click save  it updates it in the gridview.


these below links will definatly help you


http://geekswithblogs.net/dotNETvinz/archive/2009/02/22/gridview-insert-edit-update-and-delete--the-ado.net-way.aspx if
using bounded field column


http://geekswithblogs.net/dotNETvinz/archive/2009/06/10/adding-rows-in-gridview-with-edit-update-and-delete-functionality.aspx if
using template field column



for (int i = 0; i < GridView1.Rows.Count; i++)

{

GridViewRow row = GridView1.Rows[i];

bool isChecked = ((CheckBox)row.FindControl("chk")).Checked;


if (isChecked)

{

string cvalues;

cvalues = cvalues +  row.cells[1].text + "~";




if (cvalues != null)

{

Response.Redirect("covering_expn.aspx?name=" + cvalues);

}




I have 9 columns in a gridview and want to access the  form_no(checked entries in the gridview) column in another page...


I want it to be assigned to a variable than passed to another page where i want it to access all other fields corresponding to checked form no.



沒有留言:

張貼留言