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 6590533
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 25, 20262026-05-25T17:18:43+00:00 2026-05-25T17:18:43+00:00

I have to insert fix number of rows to gridview. I am not using

  • 0

I have to insert fix number of rows to gridview. I am not using database and also not creating row one by one.

I initially want 7 rows with 3 column, with first column having text stored in my array.

I am creating gridview as,

<asp:GridView ID="GridView1" runat="server" AutoGenerateColumns="false" Height="146px"
        OnLoad="row_created" Width="308px">
        <Columns>
            <asp:BoundField HeaderText="Day" />
            <asp:TemplateField HeaderText="Available rooms">
                <ItemTemplate>
                    <asp:TextBox ID="txt1" runat="server"></asp:TextBox>
                </ItemTemplate>
            </asp:TemplateField>
            <asp:TemplateField HeaderText="Price">
                <ItemTemplate>
                    <asp:TextBox ID="txt2" runat="server"></asp:TextBox>
                </ItemTemplate>
            </asp:TemplateField>
        </Columns>
    </asp:GridView>
  • 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-05-25T17:18:44+00:00Added an answer on May 25, 2026 at 5:18 pm

    why not creating a class object then bind it to the grid, set default values for index to display it as Row Number, and all other members Day, price and Rooms filled back from user

    something like:

     class MyObject
      {
         public int Index { get; set; }
         public string Day { get; set; }
         public decimal Price { get; set; }
         public string Rooms { get; set; }
       }
    

    use it like this

    List<MyObject> lst = new List<MyObject>();
    lst.Add(new MyObject { Index = 1});
    lst.Add(new MyObject { Index = 2});
    

    p.s.: Names and usage is just for explaining the idea

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I want insert following checkbox in a row from database table, but have error,
I'm new to ADO.NET so asking for help. I have to insert large number
I have form data that I insert into a database when the user clicks
I have a function that I am using to insert values in to my
I have a C# application that must insert one parent record, and at least
I have the following insert statement which works fine on one system running SQL
We have a client database that is using a float datatype for a column.
I have insert.php verify.php in Insert.php I have a form with some fields and
I have an INSERT query that is pulling data from two tables and inserting
I have an insert query that gets generated like this INSERT INTO InvoiceDetail (LegacyId,InvoiceId,DetailTypeId,Fee,FeeTax,Investigatorid,SalespersonId,CreateDate,CreatedById,IsChargeBack,Expense,RepoAgentId,PayeeName,ExpensePaymentId,AdjustDetailId)

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.