Results 1 to 2 of 2

Thread: [2005] Cell's Value of an Unbound DataGridView

  1. #1

    Thread Starter
    Hyperactive Member
    Join Date
    Jun 2006
    Posts
    274

    [2005] Cell's Value of an Unbound DataGridView

    I had been searching the net as well as MSDN about this, but I don't know if it's just me that can't figure it out.

    Quite simple one may think, on my DataGridView are Column1 and Column2 columns.On a certain event(say Button_Click) of a button, a new row would be added and Column1 and Column2 would have certain values.By the way, both columns as a TextBoxColumn.

    On a ListView point of view, this could be accomplish by merely ListView.Items.Add

    Hope someone could lead me to the right solution.Thanks.

  2. #2
    Super Moderator jmcilhinney's Avatar
    Join Date
    May 2005
    Location
    Sydney, Australia
    Posts
    111,221

    Re: [2005] Cell's Value of an Unbound DataGridView

    You just add to the grid's Rows collection. The Add method is overloaded so you can either specify the values for the cells or else get the index of the row and then set the values.
    Why is my data not saved to my database? | MSDN Data Walkthroughs
    VBForums Database Development FAQ
    My CodeBank Submissions: VB | C#
    My Blog: Data Among Multiple Forms (3 parts)
    Beginner Tutorials: VB | C# | SQL

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width