inserting multiple rows at a time
-
Hai all,, Actually i got a grid control on which am displaying some content from the database..by using the template columns....i have bounded the content with the datagrid in such a way that information in the all the rows is editable(say 10 rows each of 3 columns) i.e by placeing textbox in the itemtemplate....Know whats the problem is--->am using a button(only one) in the footer of the grid ...while i clicked on the button i want to update the database with the updated information in the editable textboxes(all the content)..plz help me out or send me any article related to this :rose:
-
Hai all,, Actually i got a grid control on which am displaying some content from the database..by using the template columns....i have bounded the content with the datagrid in such a way that information in the all the rows is editable(say 10 rows each of 3 columns) i.e by placeing textbox in the itemtemplate....Know whats the problem is--->am using a button(only one) in the footer of the grid ...while i clicked on the button i want to update the database with the updated information in the editable textboxes(all the content)..plz help me out or send me any article related to this :rose:
Hi Yuvachandra, Why you are displaying all data in textboxes. If you need that there will happen unwanted data changes.Am I right? If you want to find which textbox is changed,You should iterate through all. So if dimension is 10x3 you should make 30 iteration.If the direction is bigger than that???(it is possible to do but...time...complexity..) I think, you know that there is a provision in grid that, we can make a Particular row to be editable. I think it is better to go on that way. And now also, if you really need it.....Post... we will try...
To succeed, we must first believe that we can. Sherin Iranimose
-
Hi Yuvachandra, Why you are displaying all data in textboxes. If you need that there will happen unwanted data changes.Am I right? If you want to find which textbox is changed,You should iterate through all. So if dimension is 10x3 you should make 30 iteration.If the direction is bigger than that???(it is possible to do but...time...complexity..) I think, you know that there is a provision in grid that, we can make a Particular row to be editable. I think it is better to go on that way. And now also, if you really need it.....Post... we will try...
To succeed, we must first believe that we can. Sherin Iranimose
ya...it is compulsary,,bcz there is a scenarion that i ahve to expose all the content to my enduser..anyhow i finded the solution.....Thanks for ur kind reply... this is the code i used foreach(DataGridItem val in DataGrid1.Items) { string st,st1,st2; st=((Label)val.Cells[0].FindControl("lblAccountId")).Text; st1=((TextBox)val.Cells[1].FindControl("AccCode")).Text; st2=((TextBox)val.Cells[2].FindControl("Descrip")).Text; dataAdapter=new SqlDataAdapter("update AccountCode set AccountCode='" + st1 + "',Description='" + st2 + "'where AccountId=" + st,con); dataAdapter.Fill(ds,"contentTable"); }
-
ya...it is compulsary,,bcz there is a scenarion that i ahve to expose all the content to my enduser..anyhow i finded the solution.....Thanks for ur kind reply... this is the code i used foreach(DataGridItem val in DataGrid1.Items) { string st,st1,st2; st=((Label)val.Cells[0].FindControl("lblAccountId")).Text; st1=((TextBox)val.Cells[1].FindControl("AccCode")).Text; st2=((TextBox)val.Cells[2].FindControl("Descrip")).Text; dataAdapter=new SqlDataAdapter("update AccountCode set AccountCode='" + st1 + "',Description='" + st2 + "'where AccountId=" + st,con); dataAdapter.Fill(ds,"contentTable"); }
-
that's wasn't i mean..but this is kind of situation( i even contradict with mt lead )we must and should expose all the boxes to be editable though he may update 1 or 2 boxes of many(ofcourse it's a unnesessary burdon,i know) ..anyhow thanqs for ur kind and honest replay:rose::rose: