Click here to Skip to main content
15,897,334 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
following is my CodeConverter .Aspc.cs code
C#
protected void Page_Load(object sender, EventArgs e)
        {
            
                FirstGridViewRow();
                
            
        }

        public void FirstGridViewRow()
        {
            DataTable dt = new DataTable();                    
            dt.Columns.Add("M", typeof(string));
            dt.Columns.Add("L", typeof(string));
            DataRow row = null;
            row = dt.NewRow();
            //row["RowNumber"] = "1";            
            row["M"] = string.Empty;
            row["L"] = string.Empty;
            ViewState["CurrentTable"] = dt;           
            GrdAdmin.DataSource = dt;
            GrdAdmin.DataBind();
        }

    public void GRID(string abcd, string mate)
        {
            string aaaa = abcd;
            string mattype = mate;
            

            if (ViewState["CurrentTable"] != null)
            {
                DataTable dtCurrentTable = (DataTable)ViewState["CurrentTable"];
                DataRow drCurrentRow = null;

                drCurrentRow = dtCurrentTable.NewRow();                         
                drCurrentRow["M"] = aaaa ;
                drCurrentRow["Le"] = mattype ;
                
                dtCurrentTable.Rows.Add(drCurrentRow);
                ViewState["CurrentTable"] = dtCurrentTable;

                GrdAdmin.DataSource = dtCurrentTable;
                GrdAdmin.DataBind();

            }
            else
            {
                Response.Write("ViewState is null");
            }
            SetPreviousData();
        }

And this is my AAA.cs File
C#
public void getinstrumentconnection(int pid, string Email, string instru)
       {
           int partid = pid;
           string mcode = Email;
           string abcd = instru;

           CodeConverter conv = new CodeConverter();
           conv.GRID(mcode , abcd );

           }
Posted
Updated 8-Jan-15 17:22pm
v3
Comments
Jeet Gupta 13-Jan-15 0:37am    
so where is the exactly problem coming for binding the gridview

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900