954,518 Members — Technology Publication meets Social Media
Username:
Password:
Lost login information?
Have something to say? Contribute New Article Reply to this Article

Creating Columns At Runtime

I m creating columns at runtime,I want to know how add delete & edit buttons in each row & to create them at runtime..Foll code create columns at runtime -

protected void Page_Load(object sender, EventArgs e)
    {
        try
        {
            if (!IsPostBack)
            {
                DataTable dt = new DataTable();
                dt.Columns.Add("SNo");
                dt.Columns.Add("First Name");
                dt.Columns.Add("Last Name");
                dt.Columns.Add("EMail");
                dt.Columns.Add("Address");
                dt.Columns.Add("Phone No");

           }
        }

        catch (Exception ex)
        {
            Label1.Text = ex.Message.ToString();
        }

    }
mansi sharma
Junior Poster in Training
75 posts since Apr 2008
Reputation Points: 17
Solved Threads: 0
 

Sorry, wrong forum. Post your question to DaniWeb's C# forum .

Teme64
Veteran Poster
1,031 posts since Aug 2008
Reputation Points: 218
Solved Threads: 203
 

Do you really want the buttons in the row? It seems like you should have buttons on the page near the grid to do customizations as you don't want to repeat these buttons for every row on the grid.

sknake
Industrious Poster
4,954 posts since Feb 2009
Reputation Points: 1,764
Solved Threads: 735
 

This article has been dead for over three months

Post: Markdown Syntax: Formatting Help
You