etsellinc
asked on
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
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
ASKER
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
This could be a possible solution but I await a simpler solution.
Thanks,
Mark
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.
ASKER
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
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
Check this class reference and see if you can use any event
http://msdn.microsoft.com/en-us/library/microsoft.visualbasic.powerpacks.datarepeater.aspx
http://msdn.microsoft.com/en-us/library/microsoft.visualbasic.powerpacks.datarepeater.aspx
ASKER
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
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
SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
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.
CodeCruiser tried to help with the development of a data repeater method but we were unable to resolve a few problems.
http://blogs.msdn.com/b/vsdata/archive/2009/08/12/datarepeater-control-for-windows-forms.aspx