Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8321907
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 8, 20262026-06-08T23:11:11+00:00 2026-06-08T23:11:11+00:00

How to Add Textfield column into Gridview in asp.net C# ? I need to

  • 0

How to Add Textfield column into Gridview in asp.net C# ?

I need to add a Text field Column at last of the Gridview, I create Data Table dynamically like this. I need to add text fields for comisson column

DataTable dt = new DataTable(); // create data table
            dt.Columns.Add("TransDate"); // create column 1
            dt.Columns.Add("ExHouse");// create column 2           
            dt.Columns.Add("RemName");
            dt.Columns.Add("Currency");
            dt.Columns.Add("Amount");
            dt.Columns.Add("LKRAmount");
            //dt.Columns.Add(new DataColumn("Comission", typeof(string))); 
            dt.Columns.Add("Comission");
            dt.Columns.Add("ValueDate");

            DataRow dr = dt.NewRow(); // Create new Row
            TextBox comi=new TextBox();
            dr["TransDate"] = RemittanceToSelectedTable.TransDate; 
            dr["ExHouse"] = RemittanceToSelectedTable.ExHouse; //add data to coolumn no2
            dr["RemName"] = RemittanceToSelectedTable.RemName;
            dr["Currency"] = RemittanceToSelectedTable.Currency;
            dr["Amount"] = RemittanceToSelectedTable.Amount;
            dr["LKRAmount"] = RemittanceToSelectedTable.LKRAmount;

            dr["ValueDate"] = RemittanceToSelectedTable.ValueDate;
            dr["Comission"] = comi;

            aa.Add((string)dr["TransDate"]); 
            ab.Add((string)dr["ExHouse"]);
            ac.Add((string)dr["RemName"]);
            ad.Add((string)dr["Currency"]);
            ae.Add((string)dr["Amount"]);
            af.Add((string)dr["LKRAmount"]);
          //  ah.Add((string)dr["Comission"]);
            ag.Add((string)dr["ValueDate"]); 


            for (i = 0; i < ag.Count; i++)
            {
                dt.Rows.Add(aa[i], ab[i], ac[i], ad[i], ae[i], af[i], ag[i]); // add rows to data table
            }

            return dt;

Thanks !

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-08T23:11:13+00:00Added an answer on June 8, 2026 at 11:11 pm

    To add rows to the DataTable you could use.

    DataRow dr = dt.NewRow(); // Create new Row
    dr["TransDate"] = RemittanceToSelectedTable.TransDate; 
    dr["ExHouse"] = RemittanceToSelectedTable.ExHouse; //add data to coolumn no2
    dr["RemName"] = RemittanceToSelectedTable.RemName;
    dr["Currency"] = RemittanceToSelectedTable.Currency;
    dr["Amount"] = RemittanceToSelectedTable.Amount;
    dr["LKRAmount"] = RemittanceToSelectedTable.LKRAmount;
    dr["ValueDate"] = RemittanceToSelectedTable.ValueDate;
    dr["Comission"] = 0; //default value for commission
    dt.Rows.Add(dr);
    

    Then to display this your commission textbox, you do not create a textBox in the data. That is the control where it will be presented. Your data will be text, int, float.

    <asp:BoundField HeaderText="Comission" DataField="Comission"></asp:BoundField>
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

How can I add an input text field across two columns in a three-column
i am trying to create a data table from a tab delimited text file.I
Hey guys, I'm trying to add a textfield.text entry to an array. I want
I need to add contents of textfield named productName to an NSMutableArray named cartArray
i have a table with single row (textfield) and Add Row button, when user
I want to add and fetch the value from dynamically created textfield with tag
I am trying to build a form where users can add a text field
I'm trying to add an additional text field to magento's product review. It looks
I want to create Grid that has 3 columns. One column is 'textfield' and
In java Swing table, how to split a cell into two, one is TextField,

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.