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
745
how to copy ultrawebgrid data to dataset.. urgent
posted

hi, i just want to copy my

 ultrawebgrid(infragistics) data to a dataset........

 below am showing my code

DataTable dtGridView = new DataTable();

 dtGridView = ((DataTable)this.UltraWebGrid1.DataSource);

DataSet dsgrid = new DataSet();

dsgrid.Tables.Add(dtGridView);

but am getting null...... please help me out

Regards

naag

  • 1765
    posted

    Hello Naag, Not sure if I correctly understood your requirement. If you are looking forward to retrieve UltraWebGrid datasource, you can use session state in order to store and retrieve datalist. Below is a code snippet on this same. Hope this helps.

    DataSet ds = new DataSet();
                DataTable dt;
                if (Session["sData"] != null)
                    dt = Session["sData"] as DataTable;
                else
                {
                    dt = ds.Tables.Add("Parent");
                    dt.Columns.Add("ID");
                    dt.Columns.Add("Value");
                    dt.Columns.Add("Price");
                    for (int i = 0; i < 6; i++)
                    {
                        dt.Rows.Add(new object[] { i, "Foo" + i, i + 5 });
                    }

                    Session["sData"] = dt;
                    UltraWebGrid1.DataSource = dt;
                    UltraWebGrid1.DataBind();
                }

    Thank you,

    Swetha