Click here to Skip to main content
15,896,727 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hi,

I am using a gridview in which data is fed. I am using checkboxes to select data on every row, when a checkbox is checked the data should be selected and when i should click on the button taken at the bottom the data from that row should move from that gridview to anoder gridview .

the gridview 1 is bounded to to database's table called customer and the gridview 2 is bounded to table customer_copy.

however the data is not moving properly...

I have written the code in visual studio and I m pretty worried as this is stopping my project to get completed.

pls help

regards,

Taresh
Posted
Updated 8-Feb-12 19:42pm
v2
Comments
[no name] 9-Feb-12 0:59am    
paste the code to check how exactly u done that....
zyck 9-Feb-12 1:04am    
can you post your code if possible
[no name] 9-Feb-12 1:41am    
first paste you software code...we will try to help you out then only...
zyck 9-Feb-12 3:17am    
how many records in your gridview 1?

Hello,

you said: "When i should click on the button taken at the bottom the data from that row should move from that gridview to anoder gridview"
And Also: "gridview 2 is bounded to table customer_copy"

You didn't post the code but I think you want to move the data from grid1 to grid2 directly.
Why don't you attempt to update the customer_copy table after clicking on the button?
 
Share this answer
 
C#
//your datatable (all)
            DataTable dtAll = getTable();

            //your new datatable (only selected)
            DataTable dtSelected = dtAll.Clone();

            //save data
            //Save using  Grid
            foreach (GridViewRow rw in grid1.Rows)
            {
                //copy updated data
                if (((CheckBox)rw.Cells[0].FindControl("uxIncludeckbox")).Checked == true)
                {
                    dtSelected.Rows.Add(dtAll.Rows[rw.RowIndex]);
                }
            }
//Now dtSelected is Selected Datatable
//Bind it to another grid
 
Share this answer
 
v2
Comments
zyck 9-Feb-12 3:19am    
nice solution

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900