Results 1 to 4 of 4

Thread: progress bar in control

  1. #1

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

    progress bar in control

    Is it possible to include in a column a progress bar in a ListView control?
    What about in a DataGridView?

    using .NET 2.0.

    if so - how?

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

  2. #2
    Hyperactive Member
    Join Date
    Oct 2001
    Location
    Washington, DC
    Posts
    422

    Re: progress bar in control


  3. #3

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

    Re: progress bar in control

    Thanks
    very difficult to follow! lol. Or im having a bad day....

    is there another way?

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

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

    Re: progress bar in control

    You can embed any control you like in a DataGridView as it's been designed from the ground up to support that. The thing is, most controls embedded in a DataGridView are for editing the contents of a cell. With a ProgressBar there will be no in-place editing, so you don't need any actual Progressbar controls.

    Normally, when you want to create your own column type for the DataGridView, you inherit the DataGridViewColumn class to create your own column type, inherit the DataGridViewCell class to create your own cell type and inherit your desired control and implement the IDataGridViewEditingControl interface to create your own editing control. For an example of how that's done see here. What I would recommend is creating your own DataGridViewProgressBarColumn and DataGridViewProgressBarCell classes, but do not create a DataGridViewProgressBarEditingControl class. In the cell you would use a ProgressBarRenderer object to draw the appearance of a ProgressBar in your cell without ever creating a ProgressBar control.

    As for the ListView, it was never intended to support embedded controls so you would have to hack it. I've seen several instructions on how to do that, including this one.
    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