My Calendar control is cut - calendar

I've got an own control with a calendar popup and other functionality.
I've placed that Control into a grid in the content of another Page.
My problem now is, that the Calendar Control is cut. So i only see half of the calendar. How can i bring it to the Front? Like the normal DatePicker Control does??
Update:
What I'm trying to build is a something like the DatePickerControl but with more functionality. It doesn't look so bad so far, the control itself works fine, but implemented into a content area it cuts the calendar control. The calendar control should be visible when a textbox has the focus,what I need to find, is a way to put the calendar to the front to create an overlay for the control. If someone has an idea about how to do it I'd appreciate it.

If its a calendar control used in grid of asp.net then specify a fixed size to your calendar control and accordingly set the width of grid column.

Related

wpf how to change controls within a grid

I started looking at wpf recently and am having a hard time wrapping my head around it. I have written plenty of c++ and c# but xmal seems a bit foreign to me right now. I have created a main window that has a grid. Within the grid i have a user control that i dynamically create buttons. Depending on which button the user presses the control should load another user control in place of the current control, kind of how a win7 phone would work... This is a desktop app not a phone app.. just wanted to give you an example of the desired result. I have looked at Pages and Navigation but i don't think this what i'm looking for. Can someone please point me in the right direction. Thanks
You could put a "ContentControl" in your Xaml
and than in your code change it's content, like:
ContentControl1.Content = new MyUserControl();

Is it possible for WinForm controls (Panel,etc.) to grow like a webform control?

I'm converting an app from ASP.NET WebForms to WinForms. There is one asp.net page which contains a ListView/Repeater that contains several custom controls, which in turn contain a ListView with other custom controls. Basically the layout looks like a TreeView, but on each node/leaf there are few controls like comboboxes, etc.
When this is in ASP.NET, the page automatically lays itself out, so it is several screens tall - if I add 20 buttons into a Panel, it will grow and the browser will get scrollbars.
I'd like to do the same thing in a WinForms application - so I'll have a user control that will contain a lot of controls in a some variation of Panel (Flow, Table layout), and the controls might have another controls inside them, etc.
The problem is, that when I make winforms app, each control has specific height in the design time. I'd like some user controls to be able to grow with their contents - so they'll add up. In the main Form, there should be a vertical scrollbar, just like in the web browser when the generated page is taller than the screen.
I'd just like to get some general pointers in the right direction. Thanks.
Use Anchor and Dock container properties.
Yes, to expound on Anchor and Dock...try this
-Place a Panel on an empty form, and set its dock property to Top
-place a textbox in the panel, and Dock it to Full...it should fill the whole top panel
-Place a splitter on the form, and if not already docked correctly, set its dock to top
-place another panel below the splitter, and set its Dock to Fill
-place another textbox inside the lower panel and fill it as as well
Now you have a form with two resiable textboxes and will resize when the form does.
*you may have to set the textbox MultiLine property to true but not sure.
Hope this helps.
Anchor the controls to the parent. Anchoring all four sides will cause it to stretch.
If the Anchoring and Docking answers don't work for you, there is another option. It's not pretty, but you can access a control's properties and change them dynamically during runtime. You'd do something like: if(listBox.Items.Count > [yourVal]) listBox.height = [yourFormula] or something.
It's been a while since I've done a Win Form (and I don't have my IDE fired up at the moment) but I'm pretty sure there's even a ScrollPanel or other scrolling control that you can set on your form.
That said, when you're working with WinForms, the less scrolling you can make your users do, the better.

How to put borders in panels background like outlook day view, when the panel is sizable?

I'm talking WPF...
I have a panel (with virtualization). The panel has a custom measure and arrange implementation.
I want the panel background to look like Outlook calendar in the day view (with the lines for each amount of time) any suggestions?
I think the simplest way is to override the panel's OnRender and draw the lines (or place a new custom control behind the panel that will draw the lines).

I want to create a combobox in wpf

I want to create a combobox with some style. I dont want old dropdown what we are getting. I want some new dropdown which looks very nice. Is there any way to create a dropdown like that.
Plz give me suggestions
Check this link out on msdn. This is the actual control template for the combo box. You can copy and paste this into your application (within your app's Resources).
Create a form and slap a combo box on it with some data in it. Then start changing the control template and view the results. Start off simply by changing colors and adding borders around elements to see what controls which part. Then you can start switching out larger parts of the template to match what you're looking for.
one can start with the standard combobox, and then use various controls and styles to change the look and feel of the control, and it's corresponding drop down.

DatePicker with the ability to choose a span

Here is a quick visual of the idea that I got from Google Analytics.
ComboBox Collapsed:
ComboBox Collapsed http://www.googlemapscontrol.net/images/CalendarDropDownClosed.jpg
ComboBox Expanded:
ComboBox Expanded http://www.googlemapscontrol.net/images/CalendarDropDownOpen.jpg
I am not concerned with the functionality of the timeline or the date range text boxes. Basically I am looking to have something that looks kind of like a ComboBox with a single calendar control. When the date range is selected and the control is closed then the range is shown in the text box.
I don't think that I can get a ComboBox to behave this way and I think that I need to use something along the lines of a textblock, button and a popup.
Does anyone have a sample I can start with?
If you don't have a sample how would you approach this issue?
Thanks
The WPF Toolkit has a Calendar/DatePicker control that could be a suitable base for you to modify into an elaborate date range picker.
I would start with the DatePicker Generic.xaml file from the WPF Toolkit distribution, and examine what they have done with the DatePicker control template. The interesting section for you will be around the area that PART_TextBox and PART_Button is used. They indeed use a combination of grids, textbox, button, and popup controls.
Hope that helps!

Resources