Jagz S
Jagz S

Reputation: 907

How can we open raddatepicker popup window up the Radwindow popup

I have raddatepicker control in radwindow.The size of radwindow is fixed. when i open the raddatepicker popup it shows scroll bar in radwindow due to less space.

I don't want to show the scroll bar. so my question is Can we open the datepicker popup upon the radwindow.

scroll bar when datepicker popup is open

Upvotes: 2

Views: 4395

Answers (3)

Nishantha
Nishantha

Reputation: 6685

You can omit scroll bars by changing the position of the RadDatePicker popup.

The solution I found here.

.aspx.cs

protected void Page_Load(object sender, EventArgs e) 
{ 
    RadDatePicker1.DatePopupButton.Attributes.Add("onclick", "PopupAbove(event, '" + RadDatePicker1.ClientID + "');return false;"); 
}

.aspx

<telerik:RadDatePicker ID="RadDatePicker1" Runat="server"> 
</telerik:RadDatePicker>

.aspx JavaScript

<script type="text/javascript"> 
function PopupAbove(e, pickerID) 
{ 
    var datePicker; 
    if (pickerID == null) 
    { 
        datePicker = $find("<%= RadDatePicker1.ClientID %>"); 
    } 
    else 
    { 
        datePicker = $find(pickerID); 
    }     
    var textBox = datePicker.get_textBox(); 
    var popupElement = datePicker.get_popupContainer();     
    var dimensions = datePicker.getElementDimensions(popupElement); 
    var position = datePicker.getElementPosition(textBox);     
    datePicker.showPopup(position.x, position.y - dimensions.height);     
} 
</script> 

You can popup position by changing datePicker.showPopup(width,height);

ex.

datePicker.showPopup(position.x-100, position.y - 100);

Upvotes: 0

rdmptn
rdmptn

Reputation: 5603

Use the ContentTemplate of the RadWindow to have all controls inside on the same page, instead of in an iframe: http://demos.telerik.com/aspnet-ajax/window/examples/contenttemplatevsnavigateurl/defaultcs.aspx.

Upvotes: 1

Win
Win

Reputation: 62260

RadDatePicker has PopupDirection property. You can use TopLeft to popup top instead of bottom.

<telerik:RadDatePicker runat="server" ID="RadDatePicker1" PopupDirection="TopLeft">
</telerik:RadDatePicker>
  • TopLeft
  • TopRight
  • BottomLeft
  • BottomRight (Default)

Upvotes: 0

Related Questions