[Okta Webinar] Learn how to a build a cloud-first strategyRegister Now

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 442
  • 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
NEW Veeam Agent for Microsoft Windows

Backup and recover physical and cloud-based servers and workstations, as well as endpoint devices that belong to remote users. Avoid downtime and data loss quickly and easily for Windows-based physical or public cloud-based workloads!

 
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

Featured Post

Free Tool: Site Down Detector

Helpful to verify reports of your own downtime, or to double check a downed website you are trying to access.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

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