Results 1 to 4 of 4

Thread: [2.0] datagridview column bind?

Threaded View

  1. #1

    Thread Starter
    PowerPoster
    Join Date
    Aug 2003
    Location
    Edinburgh, UK
    Posts
    2,773

    [2.0] datagridview column bind?

    I have an arraylist as my datasource.
    Obviously you cannot directly bind this to the datagridview, so I have to go through each item in the collection, then add the items in the datagridview.

    question is, how can I specify which column to place the current data in the datagridview?

    so if we have col1, col2, col3, I wish to add the items in col2

    I tried:

    ..

    this.theDataGridView.Rows[counter].Cells["MyColumn2"].Value = currentObject.ToString();

    ..

    but going round after the first time, throws an argumentoutofrange exception in the Cells.

    thanks!
    Last edited by Techno; Jul 25th, 2006 at 12:27 PM.

    MVP 2007-2010 any chance of a regain?
    Professional Software Developer and Infrastructure Engineer.

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