Tuesday, 4 September 2012

Reorder Data Table Coloums or to Change the Data Table Index

// Code to change the index of the Data Table Coloums


dt_Data.Columns["SlNo"].SetOrdinal(0);

Monday, 3 September 2012

Grid View Nested Items Adding


 
// code shows how to add items into the nested Grid Views

protected void Gd_ItemList_RowDataBound(object sender, GridViewRowEventArgs e)
       {
         

              if (e.Row.RowType == DataControlRowType.DataRow)
              {
                 
 GridView gv = (GridView)e.Row.FindControl("Gd_Specs");
  Label lblItemId = (Label)e.Row.Cells[0].FindControl("lblItemId");
  int itemid = Convert.ToInt32(lblItemId.Text);
 string[] p_5 = { "Stat"};
 string[] v_5 = {  itemid.ToString()  };
 gv.DataSource = ObjBL.SelectDataTableUsingSp("Report", p_5, v_5);
 gv.DataBind();
           }
    }