We help IT Professionals succeed at work.

We've partnered with Certified Experts, Carl Webster and Richard Faulkner, to bring you two Citrix podcasts. Learn about 2020 trends and get answers to your biggest Citrix questions!Listen Now

x

Custom datetimepicker in datagrid problem

Medium Priority
474 Views
Last Modified: 2013-11-26
An earlier posted question about how to have a datetimepicker within a datagrid was answered in the link: http://msdn.microsoft.com/en-us/library/7tas5c80.aspx

However, the control does not present itself as a combobox until the control is clicked into (tabbing into the control does not display the combobox). I have a lookup combobox on the same row of the datagrid and it always presents as a combobox on every row.

How can I have the custom datepicker in the datagrid present as a combobox at all times?

Thanks,
Lenny
Comment
Watch Question

CERTIFIED EXPERT
Most Valuable Expert 2012
Top Expert 2014

Commented:
It depends on the custom datetime picker control itself. The datatimepicker in .NET does render itself as a combobox. Which class that custom control inherits from?

Author

Commented:
I am unsure what is inherited.

I am new to .NET so you would have to look at the code in the link that is referenced in my question above. I used the code inthatreference and made a few tweaks to have it perform as I needed it but none of the changes affected the appearance because the appearance was the same before and after the tweaks.

Thanks for the help!

Lenny
CERTIFIED EXPERT
Most Valuable Expert 2012
Top Expert 2014

Commented:
I have gone through the link and as i said, the control is inheriting a textbox so it wont display a combobox all the time. See the image attached.
You need to change the inheritence from datagridcolumn to datagridcomboboxcolumn and may need to change other code as well to handle everything properly.
Screen.JPG

Author

Commented:
What other code may be need to be changed? If you cannot be precise, then just point me in the right direction.

I am sorry that I am so green with this - even though I have been developing software fro 38 years. I just started the learning curve about a week ago and in the process of bringing up a small application that touches on all of the coding/GUI style that I utilize in my other apps.

With your help. and others here, I hope to get up to speed quickly.

Thanks again,
Lenny
CERTIFIED EXPERT
Most Valuable Expert 2012
Top Expert 2014
Commented:
I would then suggest you to read some material on class libraries and inheritance etc. For example, all controls such as label, textbox, button etc are derived from a common class called Control. So they share the basic stuff and override the functionality that they need to. So you would need to change the inheritance and you may not need to modify any other control. First try by changing the inheritance and using the control.

Not the solution you were looking for? Getting a personalized solution is easy.

Ask the Experts

Author

Commented:
Thanks ! There will be more questions, I am certain. I am happy that people like you will be there for me!
Access more of Experts Exchange with a free account
Thanks for using Experts Exchange.

Create a free account to continue.

Limited access with a free account allows you to:

  • View three pieces of content (articles, solutions, posts, and videos)
  • Ask the experts questions (counted toward content limit)
  • Customize your dashboard and profile

*This site is protected by reCAPTCHA and the Google Privacy Policy and Terms of Service apply.

OR

Please enter a first name

Please enter a last name

8+ characters (letters, numbers, and a symbol)

By clicking, you agree to the Terms of Use and Privacy Policy.