murali athmuri

murali athmuri

  • NA
  • 36
  • 59.3k

Bind data to dynamic gridview cells

Jan 29 2013 7:04 PM
Dear sir,

I want  bind data to dynamic gridview cell. How to bind it. can u please solve my problem



 for (int j = 1; j < GridView2.Columns.Count; j++)
            {
                tim1 = GridView2.Columns[j].HeaderText;
                dt = tbal.retriveheader(clas, sec, tim1);
                dt.Columns["Column1"].ColumnName = tim1;
                DataRow dr = dt.NewRow();
                dr[tim1] = dt.Rows[0][1].ToString();

                GridView2.DataSource = dt;
                GridView2.DataBind();
            }

Answers (2)