private void Bindemptydt() { //Declare a datatable for the gridview DataTable dt = new DataTable(); //Add Columns to the datatable dt.Columns.Add("report_id"); dt.Columns.Add("param_field"); dt.Columns.Add("param_label"); dt.Columns.Add("param_type"); dt.Columns.Add("param_objtype"); dt.Columns.Add("format"); dt.Columns.Add("param_query"); dt.Columns.Add("default"); dt.Columns.Add("koneksi"); dt.Columns.Add("looping"); dt.Columns.Add("urut"); //Define a datarow for the datatable dt DataRow dr = dt.NewRow(); //Now add the datarow to the datatable dt.Rows.Add(dr); //Now bind the datatable to gridview DetailsView1.DataSource = dt; DetailsView1.DataBind(); //Now hide the extra row of the grid view DetailsView1.Rows[0].Visible = false; //Delete row 0 from the datatable dt.Rows[0].Delete(); dt.AcceptChanges(); //View the datatable to the viewstate ViewState["RptParam"] = dt; }
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)