How to add columns dynamically in gridview
-
hi, i want to add textbox columns in my Gridview dynamically. I first want to fill the gridview using dataset which i m able to...but i want to add one more extra column in the gridview at the same time. How to add that textbox column ......say on dropdownlist autopostback event or say button click event? here is the code for filling gridview using dataset
TRcmd.CommandText = "GetLoadedTRGV" TRcmd.CommandType = CommandType.StoredProcedure TRcmd.Connection = MyTRCon TRcmd.Parameters.Add(New SqlParameter("@testID", SqlDbType.NVarChar) With {.Value = testnameddl.Text}) TRcmd.Parameters.Add(New SqlParameter("@techniqID", SqlDbType.NVarChar) With {.Value = Techniqnameddl.Text}) TRadptr = New SqlDataAdapter("GetLoadedTRGV", MyTRCon) TRadptr.Fill(TRds)
Gridview1.datsource=TRds.Tables(0)
Gridview1.databind()modified on Tuesday, June 15, 2010 9:26 AM
-
hi, i want to add textbox columns in my Gridview dynamically. I first want to fill the gridview using dataset which i m able to...but i want to add one more extra column in the gridview at the same time. How to add that textbox column ......say on dropdownlist autopostback event or say button click event? here is the code for filling gridview using dataset
TRcmd.CommandText = "GetLoadedTRGV" TRcmd.CommandType = CommandType.StoredProcedure TRcmd.Connection = MyTRCon TRcmd.Parameters.Add(New SqlParameter("@testID", SqlDbType.NVarChar) With {.Value = testnameddl.Text}) TRcmd.Parameters.Add(New SqlParameter("@techniqID", SqlDbType.NVarChar) With {.Value = Techniqnameddl.Text}) TRadptr = New SqlDataAdapter("GetLoadedTRGV", MyTRCon) TRadptr.Fill(TRds)
Gridview1.datsource=TRds.Tables(0)
Gridview1.databind()modified on Tuesday, June 15, 2010 9:26 AM