Results 1 to 3 of 3

Thread: [VB 2005] DatagridView Columns And Textfiles

  1. #1

    Thread Starter
    Hyperactive Member knxrb's Avatar
    Join Date
    Jul 2007
    Location
    United Kingdom
    Posts
    321

    [VB 2005] DatagridView Columns And Textfiles

    I need some way of loading textfiles into columns in a datagridview.

    Example:
    Column1 = all text in textfile1
    Column2 = all text in textfile2
    etc, etc..

    I have 7 columns and seven textfiles. Each textfile would have a maximum of 30 lines.

    I would want it displayed as normal in a datagridview:



    knxrb

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

    Re: [VB 2005] DatagridView Columns And Textfiles

    You could inherit the DataGridViewTextBoxColumn and DataGridViewTextBoxCell classes and add a Multiline property. You would then propagate that property value to the TextBox control hosted in the cell. Alternatively you could handle the grid's EditingControlShowing event and set the Multiline property of the TextBox directly. You should read about the DataGridViewCell.EditingControl property to get some background.
    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

  3. #3

    Thread Starter
    Hyperactive Member knxrb's Avatar
    Join Date
    Jul 2007
    Location
    United Kingdom
    Posts
    321

    Re: [VB 2005] DatagridView Columns And Textfiles

    Thanks, I'll have a look

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