• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 457
  • Last Modified:

Custom datetimepicker in datagrid problem

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
0
LennyGray
Asked:
LennyGray
  • 3
  • 3
1 Solution
 
CodeCruiserCommented:
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?
0
 
LennyGrayAuthor 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
0
 
CodeCruiserCommented:
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
0
Cloud Class® Course: Certified Penetration Testing

This CPTE Certified Penetration Testing Engineer course covers everything you need to know about becoming a Certified Penetration Testing Engineer. Career Path: Professional roles include Ethical Hackers, Security Consultants, System Administrators, and Chief Security Officers.

 
LennyGrayAuthor 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
0
 
CodeCruiserCommented:
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.
0
 
LennyGrayAuthor Commented:
Thanks ! There will be more questions, I am certain. I am happy that people like you will be there for me!
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

Join & Write a Comment

Featured Post

The 14th Annual Expert Award Winners

The results are in! Meet the top members of our 2017 Expert Awards. Congratulations to all who qualified!

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