Want to protect your cyber security and still get fast solutions? Ask a secure question today.Go Premium

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 318
  • Last Modified:

Best Practice: Custom Control or Load Controls

I need to create a method to display multiple controls for a collections of items. It needs to be in a scroll-able container with column headers. Very similar to the List View except the columns will we controls instead of text.

I would like to know what would be the best way to develop this type of object. Should I create a custom control? Is it possible to use a data repeater? Load the controls in groups on the fly? What other options should I consider?

The controls for each item would have a check box, a couple labels and numeric up/down.

Mark
0
etsellinc
Asked:
etsellinc
  • 5
  • 3
2 Solutions
 
etsellincAuthor Commented:
It appears that the DataRepeater requires that it be bound to a dataset. I need something that will be a little simpler. I don't want to create a dataset just to add items if I don't have to.

This could be a possible solution but I await a simpler solution.

Thanks,
Mark
0
 
ArkCommented:
You don't need numerous editable controls - you cannot edit all items simultaneously. What you need is 1 (one) editable control and 1 (one) displaying control with overriden Paint method which fill all (or, better,visible only) cells with DrawText/DrawImage using cell's data storing in array/list/dictionary or whatever. You can move editable control to appropriate cell using mouse/keyboard events, saving data from previous cell.
0
Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 
etsellincAuthor Commented:
For: CodeCruiser

I've been working with the idea of the Data Repeater. I can't seem to find the event that indicates that a field has been updated with a new value. There are other fields that I need to update based on the change of the updated field.

I've tried both events from the data repeater and the binding source.

I have successfully created the data repeater and filled it with data. It works great!


Thanks,
Mark
0
 
CodeCruiserCommented:
Check this class reference and see if you can use any event

http://msdn.microsoft.com/en-us/library/microsoft.visualbasic.powerpacks.datarepeater.aspx
0
 
etsellincAuthor Commented:
After browsing through all the events of the data repeater there doesn't seem to be an event that fires when the data repeater item is updated with changes.

I don't believe that this is to solution for me.

I am going to follow up with a custom control that I can put code behind for validation and formatting.

Thanks for you help CodeCruiser!

Mark
0
 
CodeCruiserCommented:
0
 
etsellincAuthor Commented:
To CodeCruiser,

I checked this event out but if the index is not changed the there is no updating. This will not work.

Due to time constraints I had to move on and use a custom control. It works great! I truly was hoping that the data repeater was going to work. It would had been much easier on future projects.

Thanks for your help with this!

Mark
0
 
etsellincAuthor Commented:
The use of a custom control was the quickest and easiest solution. Although my experience with the data repeater is limited, I would had much preferred to use it. Future project would be easier since there is no need for custom controls.

CodeCruiser tried to help with the development of a data repeater method but we were unable to resolve a few problems.
0

Featured Post

Get your problem seen by more experts

Be seen. Boost your question’s priority for more expert views and faster solutions

  • 5
  • 3
Tackle projects and never again get stuck behind a technical roadblock.
Join Now