Your Privacy Matters: We use our own and third-party cookies to improve your experience on our website. By continuing to use the website we understand that you accept their use. Cookie Policy
315
copy values in UltraGriview
posted

i have two Ultragridview(Ultragridview1,Ultragridview2)

ultragridview1 data load database

after i insert 3 column (3 column no in database) and i import values for column new insert in ultragridview1

i want copy all data of Ultragridview1 to Ultragridview2 include 3 column new insert(value)

this is code  of i:Ultragridview1.DataSource=Ultragridview2.DataSource but it no view 3 column new insert and value import in 3 column.

 you help me?thank

Parents
No Data
Reply
  • 37774
    posted

    If you want to copy over all the data from *unbound* columns to another grid, you would first have to add those unbound columns to the other grid, then loop through all the rows in the grid and copy them over.  Since they're bound to the same data source, you can just do a straight loop:

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

    {

          UltraGridRow row = grid1.Rows[i];

          UltraGridRow row2 = grid2.Rows[i];

          row2.Cells["Unbound Column 1"].Value = row1.Cells["Unbound Column 2"].Value

         // Same thing for other unbound columns

    }

    -Matt

Children