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
760
Copy Contents of a WebGrid Column to Another Column
posted

I would somehow like to copy and paste the contents of an UltraWebGrid column to another column within the same grid. I'm using NetAdvantage 10.2. Can someone point me in the right direction if this is possible to do?

Parents
  • 37874
    posted

    Hi megryan,

     

    You could iterate through the rows of the grid and copy the values from one column to another:

     

        protected void Button1_Click(object sender, EventArgs e)

        {

            foreach (UltraGridRow row in UltraWebGrid1.Rows)

            {

                row.Cells[2].Value = row.Cells[1].Value;

            }

        }

     

    Another option would be to create a DataTable and write in it the values from a column you want. Then you can use this table to populate another column from the grid.

    If you have any questions, please let me know.

Reply Children