I was creating the attached dialog using a DataGridView, since this is clearly a matrix of controls. but I ran into numerous problems when embedding a DateTimePicker both to handle dates and times. SO I have abandoned that plan and now want an old fashioned set controls I can easily interact with, since they will be created on the form. But I need the rows added by the user to be an extensible list.
I need to grab Location.Y from the prior row, add n pixels and combine that with the same Location.X values from the previous row when determining the locations of each control.
That should be easy. What will be new for me is creating those controls and coming up with a way to assign a unique ID for the controls.
How do I create events for these controls when I do not know their ID's at compile time? Can I put the controls into a list so they can be refernced via their index in the list? When using the DataGridView, each event had an e.RowIndex value and that worked fine. But to repeat myself, I had so many event problems to still resolve. I think this would be quicker.
Please make suggestions or point me towards a demo program.
Notice on the attached image, when the user clicks Edit, in some cases I would need to remove the text field and replace that with a text edit field. Any suggestions on that transformation would also be appreciated.
Question: Will a TableLayoutPanel be easier for me to manage drawing this matrix of controls without the hassles I have gotten from the DataGridView??
”The time we save is the biggest benefit of E-E to our team. What could take multiple guys 2 hours or more each to find is accessed in around 15 minutes on Experts Exchange.
-Mike Kapnisakis, Warner Bros
With your subscription - you'll gain access to our exclusive IT community of thousands of IT pros. You'll also be able to connect with highly specified Experts to get personalized solutions to your troubleshooting & research questions. It’s like crowd-sourced consulting.
We can't always guarantee that the perfect solution to your specific problem will be waiting for you. If you ask your own question - our Certified Experts will team up with you to help you get the answers you need.
Our certified Experts are CTOs, CISOs, and Technical Architects who answer questions, write articles, and produce videos on Experts Exchange. 99% of them have full time tech jobs - they volunteer their time to help other people in the technology industry learn and succeed.
We can't guarantee quick solutions - Experts Exchange isn't a help desk. We're a community of IT professionals committed to sharing knowledge. Our experts volunteer their time to help other people in the technology industry learn and succeed.