Telerik Forums
UI for ASP.NET AJAX Forum
3 answers
761 views
I am trying to understand why the RadDatePicker will not populate the Input field with just calling the following statement in the PreRender method?

    protected void RadDatePickerStart_PreRender(object sender, EventArgs e) 
    { 
        if (!RadDatePickerStart.SelectedDate.HasValue) 
        { 
            RadDatePickerStart.SelectedDate = DateTime.Today.AddDays(-1); 
        } 
    } 

For me to get the value to populate to the DatePicker textbox I have to add this assignment:
RadDatePickerStart.DateInput.SelectedDate = DateTime.Today.AddDays(-1); 

Can someone please explain why that is needed?

I have a RadComboBox and upon selection of its SelectedIndexChanged event method that works without even having to set the additional DateInput.SelectedDate as you can see in this little code snippet.
    protected void rcbDateRange_SelectedIndexChanged(object sender, EventArgs e) 
    { 
        //Dates should be disabled unless Custom has been selected 
        RadDatePickerStart.Enabled = false
        RadDatePickerEnd.Enabled = false
 
        switch (rcbDateRange.SelectedValue) 
        { 
            case "WeekSun"
                RadDatePickerStart.SelectedDate = DateTime.Today.AddDays(-5); 
                RadDatePickerEnd.SelectedDate = DateTime.Today.AddDays(-1); 
                break
            case "custom"
                RadDatePickerStart.SelectedDate = DateTime.Today.AddDays(-1); 
                RadDatePickerEnd.SelectedDate = DateTime.Today.AddDays(-1); 
                RadDatePickerStart.Enabled = true
                RadDatePickerEnd.Enabled = true
                break
            default
                RadDatePickerStart.SelectedDate = DateTime.Today.AddDays(-1); 
                RadDatePickerEnd.SelectedDate = DateTime.Today.AddDays(-1); 
                break
        } 
    } 

I am not sure why you have to set the DateInput.SelectedDate in the PreRender to make it bubble up to the DatePicker's textbox.

I am using the SharedCalendar control and not sure if that makes a difference.

Just for completeness here is the aspx telerik elements:
                      <telerik:RadComboBox ID="rcbDateRange" AllowCustomText="false" Skin="WebBlue" OnSelectedIndexChanged="rcbDateRange_SelectedIndexChanged"  
                            AutoPostBack="true" runat="server">  
                            <Items>  
                                <telerik:RadComboBoxItem Text="Yesterday" Value="Yesterday" Selected="True" runat="server" />  
                                <telerik:RadComboBoxItem Text="Week To Date (Starts Sun)" Value="WeekSun" runat="Server" />  
                                <telerik:RadComboBoxItem Text="Week To Date (Starts Mon)" Value="WeekMon" runat="server" />  
                                <telerik:RadComboBoxItem Text="Prior Week (Sun-Sat)" Value="PriorSun" runat="server" />  
                                <telerik:RadComboBoxItem Text="Prior Week (Mon-Sun)" Value="PriorMon" runat="server" />  
                                <telerik:RadComboBoxItem Text="Month to Date" Value="MonthToDate" runat="server" />  
                                <telerik:RadComboBoxItem Text="Prior Month" Value="PriorMonth" runat="server" />  
                                <telerik:RadComboBoxItem Text="Quarter to Date" Value="QuarterToDate" runat="server" />  
                                <telerik:RadComboBoxItem Text="Prior Quarter" Value="PriorQuarter" runat="server" />  
                                <telerik:RadComboBoxItem Text="Year to Date" Value="YearToDate" runat="server" />  
                                <telerik:RadComboBoxItem Text="Prior Year" Value="PriorYear" runat="server" />  
                                <telerik:RadComboBoxItem IsSeparator="true" runat="server" />  
                                <telerik:RadComboBoxItem Text="Custom Range" Value="custom" runat="server" />  
                            </Items>  
                        </telerik:RadComboBox>  
  
                            <telerik:RadDatePicker ID="RadDatePickerStart" SharedCalendarID="sharedCalendar" OnPreRender="RadDatePickerStart_PreRender"  
                                Skin="WebBlue" Enabled="false" runat="server">  
                                <DateInput ID="rdpStartInput" ReadOnly="true" runat="server" />  
                            </telerik:RadDatePicker>  
  
                        <telerik:RadDatePicker ID="RadDatePickerEnd" SharedCalendarID="sharedCalendar" OnPreRender="RadDatePickerEnd_PreRender"  
                            Skin="WebBlue" Enabled="false" runat="server">  
                            <DateInput ID="rdpEndDateInput" ReadOnly="true" runat="server" />  
                        </telerik:RadDatePicker>  
 
 
        <telerik:RadCalendar ID="sharedCalendar" RangeMinDate="2005-04-01" runat="server" 
            EnableMultiSelect="false" Skin="WebBlue" Width="200px" ShowRowHeaders="false" 
            OnPreRender="sharedCalendar_PreRender" UseColumnHeadersAsSelectors="false"
        </telerik:RadCalendar 
Pavel
Telerik team
 answered on 06 May 2011
2 answers
93 views
Hello
I have an issue with a RadGrid controls and with a pager. If i make a search which returns me records on 30 pages, and i go on the last page, if i make a new search which will return records on less than 30 pages, the grid doesn't work and i get the message that there are no records, eventhough the count is greater than 0.
Can anyone help me, please?
adi
Top achievements
Rank 1
 answered on 06 May 2011
1 answer
80 views
Hi,
We use the RadDatePicker in our project. When the user click the RadDatePicker button to select the date, we will check if the condition is not matched, we need to cancel the action. And I have tried several ways, but they don't work.

 
function dateSelected(datepickerInstance, args) {
                args.CancelOpen = true;
                return false;
            }

<telerik:RadDatePicker runat="server" ID="rdp1">
    <DateInput ID="DateInput2" CausesValidation="True" runat="server"></DateInput>
    <Calendar ID="Calendar2" UseColumnHeadersAsSelectors="False" UseRowHeadersAsSelectors="False"   ViewSelectorText="x" runat="server"></Calendar>
    <DatePopupButton HoverImageUrl="" ImageUrl=""/>
    <ClientEvents OnPopupOpening="dateSelected" />
</telerik:RadDatePicker>

Please help me.

Thanks a lot!

Blind

Shinu
Top achievements
Rank 2
 answered on 06 May 2011
1 answer
70 views
Hi,

I had a rad ajax manager which updates my panel visible and invisible thorugh my Radcombobox. My panel has RadSplitter..
but i am not able to dock undock the Radslidingpane .. it giving me a javascript error as "the function is not defined". but i am defining the function.. if i remove ajax manager its working fine.. how to solv my problem

      <script type="text/javascript">
          function Productchangesize() {
              var splitter = $find("<%=RadSplitter_CreateProduct.ClientID%>");
              var width = 280;
              splitter.set_width(width);
          }
 
          function ProductChangeUndockSize() {
              var splitter = $find("<%=RadSplitter_CreateProduct.ClientID%>");
              var width = 22;
              splitter.set_width(width);
          }
 
</script>  
 
<telerik:RadScriptManager ID="RadScriptManager1" Runat="server">
    </telerik:RadScriptManager>
 
                <telerik:RadAjaxManager ID="RadAjaxManager1" runat="server">
                <AjaxSettings>
                    <telerik:AjaxSetting AjaxControlID="RadComboBox1">
                    <UpdatedControls>
                        <telerik:AjaxUpdatedControl ControlID="Panel1" />   
                    </UpdatedControls>
                    </telerik:AjaxSetting>
                    </AjaxSettings>
                    </telerik:RadAjaxManager>
                    <telerik:RadAjaxLoadingPanel runat="server" ID="loadingpanel"/>
 
   
    <telerik:RadComboBox ID="RadComboBox1" Runat="server" AutoPostBack="true">
        <Items>
            <telerik:RadComboBoxItem Text="Item1" />
            <telerik:RadComboBoxItem Text="Item2" />
            <telerik:RadComboBoxItem Text="Item3" />
            <telerik:RadComboBoxItem Text="Item4" />
        </Items>
    </telerik:RadComboBox>
 
 
<asp:Panel ID="Panel1" runat="server" BackColor="White">    
     <table width="500">
                     <tr>
                        <td width="25">   
                         
                                   <telerik:RadSplitter
                             ID="aaa"
                             runat="server"
                             Orientation="Vertical"
                             Width="25"
                             VisibleDuringInit="false"
                             Height="375">
                         
                           <telerik:RadPane
                                ID="bbb"
                                runat="server"
                                BackColor="#DEE0C8">
                                
                                <telerik:RadSlidingZone
                                     ID="ccc"
                                     runat="server" BorderColor="AliceBlue" BorderWidth="3px" BorderStyle="Solid">
                                
                                  <telerik:RadSlidingPane
                                    ID="ddd"
                                    runat="server"
                                    Title="eee Details"                                   
                                    EnableDock="true"
                                    EnableResize="false" 
                                    OnClientUndocked="ProductChangeUndockSize"
                                    OnClientDocked="Productchangesize"                                
                                    Width="250" BorderColor="AliceBlue" style="border-style:solid;border-width:3px;" BorderWidth="3px" BorderStyle="Solid">
                                        <div>
                                          Hey this is mes                                       
                                     </div>
                                 </telerik:RadSlidingPane>
                               </telerik:RadSlidingZone>                           
                            </telerik:RadPane
                       </telerik:RadSplitter>                       
                        </td>
                        
                        </tr>
                     
 </table>
    </asp:Panel>


But i am getting error as undefined Productchangesize? how to do this
Iana Tsolova
Telerik team
 answered on 06 May 2011
1 answer
142 views
For layout purposes I am trying to use the RadScheduler control in Sitefinity 4.0.  I want to modify the template so that when it's clicked it goes to the event's home page.  It seems that the event page in the events widget needs the DateCreated value.  How can I cast an appointment object as an event object?  I'm trying to do something to the effect of this:

Container doesn't exist.  Is this even possible?  Or the dataitem doesn't exist.  Something gives me an object not set to instance error.

<telerik:RadScheduler runat="server" ID="Scheduler1" SelectedView="MonthView" height="100%" allowedit="false" allowdelete="false" allowinsert="false">
    <appointmenttemplate>
        <h6>
            <a href="<%=this.EventUrl %>                
                <%#((Event)Container.Appointment.DataItem).DateCreated.Year.ToString() %>
                /<%#((Event)Container.Appointment.DataItem).DateCreated.Month.ToString() %>
                /<%#((Event)Container.Appointment.DataItem).DateCreated.Day.ToString() %>
                /<%#Eval("Subject").ToString().Replace(" ", "-").ToLower() %>">
                <%#Eval("Subject") %>
            </a>
        </h6>
    </appointmenttemplate>
</telerik:RadScheduler>
Ivan Dimitrov
Telerik team
 answered on 06 May 2011
3 answers
81 views
Hello,

I am using template columns to divide a column into two or more columns. Example:

Organization
--------------------
Balance| Quantity

unlike other columns, I am unable to resize these template columns.. Can you guide me as to how can I acheive resizing of these columns as well...

Regards,
Effat
Effat
Top achievements
Rank 1
 answered on 06 May 2011
1 answer
93 views
I am loading html content from a database and whenever there is a break "<br/>" the editor adds a "<br></br>". how can this be stopped?

Thanks!
Rumen
Telerik team
 answered on 06 May 2011
12 answers
203 views
This is a follow up for

http://www.telerik.com/community/forums/aspnet-ajax/combobox/radcombobox-radtreeview-serverside.aspx

After applying the suggested workaround, I found that the combobox doesn't resize when tree nodes are expanded.
Instead, H/V scrolls are shown. Does someone know how to get rid of these scrolls and have the combo resizing when a
treenode expands?

Thanks,
Cris
Kate
Telerik team
 answered on 06 May 2011
3 answers
237 views
Hi all,

Please help!
Is there any way to disable postback at GridFilterMenuItem ?
I already tried as below but it doesn't work. 
Even Postback value always show 'False' at runtime my grid still postback when I select FilterMenuItem.

<FilterMenu EnableEmbeddedScripts="True" >
  <DataBindings><telerik:RadMenuItemBinding PostBack="false"/>
</DataBindings>
</FilterMenu >
&
Dim menu As GridFilterMenu = RadGrid1.FilterMenu
For Each item As RadMenuItem In menu.Items
    Dim a As String = item.Text
    item.PostBack = False
Next
Iana Tsolova
Telerik team
 answered on 06 May 2011
1 answer
76 views
Hi,

Can anyone help me here? I got a problem in upgrading the website from Radcontrol 1.1x to RadControl Q1 2011. Its a huge leap in version so there is a big problem on it. I already have telerik.web.ui.dll in my bin folder but the same problem I get not only in this control but almost every controls.
Genady Sergeev
Telerik team
 answered on 06 May 2011
Narrow your results
Selected tags
Tags
+? more
Top users last month
Jay
Top achievements
Rank 3
Bronze
Iron
Iron
yw
Top achievements
Rank 2
Iron
Iron
Stefan
Top achievements
Rank 2
Iron
Iron
Iron
Kao Hung
Top achievements
Rank 1
Iron
Bohdan
Top achievements
Rank 2
Iron
Iron
Iron
Want to show your ninja superpower to fellow developers?
Top users last month
Jay
Top achievements
Rank 3
Bronze
Iron
Iron
yw
Top achievements
Rank 2
Iron
Iron
Stefan
Top achievements
Rank 2
Iron
Iron
Iron
Kao Hung
Top achievements
Rank 1
Iron
Bohdan
Top achievements
Rank 2
Iron
Iron
Iron
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?