Telerik Forums
UI for ASP.NET AJAX Forum
5 answers
367 views
I am trying to enable/disable a raddatepicker control and am unable to do so. I followed the online documentation for the client-side api and when it runs, I get the msg "radAdmitDate" is undefined.

Below is my documented code. What am I doing incorrectly?

html
-------

                                                                                                               <td class="td_AEV">
                                                                                                                                    <asp:CheckBox ID="isAdmitted" runat="server" Text="Patient Admitted" Font-Size="8pt"
                                                                                                                                        onclick="EnableAdmitDate();" />
                                                                                                                                </td>

 

                                                                                                               <td class="td_AEV">
                                                                                                                                    Admit Date:<telerik:RadDatePicker ID="radAdmitDate" runat="server" Font-Size="8pt"
                                                                                                                                        Enabled="false" onblur="CheckForCompletedReqFlds('Chart');">
                                                                                                                                        <Calendar UseColumnHeadersAsSelectors="False" UseRowHeadersAsSelectors="False" ViewSelectorText="x"
                                                                                                                                            runat="server">
                                                                                                                                        </Calendar>
                                                                                                                                        <DatePopupButton HoverImageUrl="" ImageUrl="" />
                                                                                                                                        <DateInput ID="DateInput2" DateFormat="M/d/yyyy" DisplayDateFormat="M/d/yyyy" runat="server">
                                                                                                                                        </DateInput>
                                                                                                                                    </telerik:RadDatePicker>
                                                                                                                                </td>

 

js
----------

function EnableAdmitDate() {               
                if (document.getElementById("isAdmitted").checked == "1") {
                    var datepicker = <%= radAdmitDate.ClientID %>;
                    datepicker.DateInput.Enable();
                    datepicker.PopupButton.onclick = function()
                                            {
                                                datepicker.TogglePopup();
                                                 return false;
                                            };
                }
                else {
                    var datepicker = <%= radAdmitDate.ClientID %>;
                    datepicker.DateInput.Disable();
                    datepicker.PopupButton.onclick = null;
                }
            }

 

js runtime
---------------

function EnableAdmitDate() {               
                if (document.getElementById("isAdmitted").checked == "1") {
                    var datepicker = radAdmitDate;
                    datepicker.DateInput.Enable();
                    datepicker.PopupButton.onclick = function()
                                            {
                                                datepicker.TogglePopup();
                                                 return false;
                                            };
                }
                else {
                    var datepicker = radAdmitDate;
                    datepicker.DateInput.Disable();
                    datepicker.PopupButton.onclick = null;
                }
            }

Bill
Top achievements
Rank 2
 answered on 29 Nov 2010
1 answer
256 views
Hello Sir,

We use RadComboBox inside RadWindow as the following:

<telerik:RadWindow ID="WinFirms" runat="server" Title="Select Firm" Width="500" Height="200" Behaviors="Move"  VisibleStatusbar="false"
    VisibleOnPageLoad="false" Modal="true" EnableShadow="true" DestroyOnClose="false" Skin="Sunset">
    <ContentTemplate>
    <div style="padding:10px;">
        <div style="float:left; width:10px;">
        Firm:
        </div>
        <div>
            <telerik:RadComboBox runat="server" ID="ddlFirm" Width="100%" MarkFirstMatch="True" CausesValidation="false" HighlightTemplatedItems="true">
                <HeaderTemplate>
                        <table style="width:95%" cellspacing="0" cellpadding="0" class="MultiColumnComboBox">
                            <tr>
                                <td style="width: 50px">DFSA No</td>
                                <td style="width: 100px">Firm Name</td>
                                <td style="width: 50px">Capacity</td>
                            </tr>
                        </table>
                    </HeaderTemplate>
                    <ItemTemplate>
                        <table style="width:100%" cellspacing="0" cellpadding="0" class="MultiColumnComboBox">
                            <tr>
                                <td style="width: 20%; color:Gray;"><%#DataBinder.Eval(Container.DataItem, "DfsaNo")%> </td>
                                <td style="width: 70%"><%#DataBinder.Eval(Container.DataItem, "DName")%></td>
                                <td style="width: 10%; color:Gray;"><%#DataBinder.Eval(Container.DataItem, "Capacity")%></td>
                            </tr>
                        </table>
                    </ItemTemplate>
                </telerik:RadComboBox>
        </div>
        </div>
        <div style="text-align:center;">
            <asp:RequiredFieldValidator ID="RequiredFieldValidator1" runat="server" ErrorMessage="Firm is required" Display="Dynamic" ControlToValidate="ddlFirm"></asp:RequiredFieldValidator>
            <asp:Button runat="server" id="WinOK" OnClientClick="SubmitFirmDialog();return false;" Text="OK" UseSubmitBehavior="False" ValidationGroup="SubmitWindow" CausesValidation="true"/>
            <asp:Button runat="server" id="WinCancel" OnClientClick="Hide();return false;" Text="Cancel" UseSubmitBehavior="False"  />
        </div>
    </ContentTemplate>
</telerik:RadWindow>

We Fill DDL as following

Sub LoadFirmData()
        ddlFirm.DataSource = FirmDetails.GetAfAspRaFirmByVal()
        ddlFirm.DataBind()
End Sub

We set the values inside ItemDataBound even handler after binding it

Protected Sub ddlFirm_ItemDataBound(ByVal sender As Object, ByVal e As Telerik.Web.UI.RadComboBoxItemEventArgs) Handles ddlFirm.ItemDataBound
        e.Item.Text = e.Item.DataItem.DName
        e.Item.Value = e.Item.DataItem.PersonID & "%" & e.Item.DataItem.Capacity
        e.Item.Attributes.Add("FirmID", e.Item.DataItem.PersonID)
        e.Item.Attributes.Add("Capacity", e.Item.DataItem.Capacity)
        e.Item.Attributes.Add("DfsaNo", e.Item.DataItem.DfsaNo)
    End Sub

First page Load the data loads successfully and displayed inside the ComboBox.

 

When a callback happens the ComboBox loads all data as empty as the following HTML:

 

<li class="rcbItem  rcbTemplate">

    <table cellspacing="0" cellpadding="0" class="MultiColumnComboBox" style="width: 100%;">

        <tbody><tr>

            <td style="width: 20%; color: Gray;">&nbsp;</td>

            <td style="width: 70%;"></td>

            <td style="width: 10%; color: Gray;"></td>

        </tr>

    </tbody></table>

</li>

 

At the same time when we assess the list items on client side we get the results of (value + attributes) correctly. But its not displayed in the dropdown.

 

Simon
Telerik team
 answered on 29 Nov 2010
4 answers
141 views

I have a radgrid with one column called ApplicationName.  When I click the "Add New Record" button to add a new record and fill out the textbox, I want to check the textbox to make sure there is not a duplicate ApplicationName in the database.  How do I access the textbox to perform validation on it and what event do I place the code inside.  I thought it would be the ItemCommand evnet but it seems to happen after the insert is completed.

Do you have an example?  I looked at the examples on the website and could not find something to use.
sxd9mm
Top achievements
Rank 1
 answered on 29 Nov 2010
7 answers
2.1K+ views
How can I create a RadGrid row programmatically?

I need to loop through the existing rows in the Radgrid and add a new row on a button click, ie., based on the number of existing rows a new row needs to be added.

or is there any way to get the ROWCount at the server-side?

Please guide me......
Neerav
Top achievements
Rank 1
 answered on 29 Nov 2010
2 answers
235 views

I tried the solution suggested and didn't work.
I think my problem is related to Framework 4.0, 
Web.config content
--------------------------
    <compilation debug="true" targetFramework="4.0">
      <assemblies>

        <add assembly="Telerik.Web.UI, Version=2008.3.1314.35, Culture=neutral, PublicKeyToken=121FAE78165BA3D4" />
        <add assembly="System.Design, Version=4.0.0.0, Culture=neutral, PublicKeyToken=B03F5F7F11D50A3A" />
        <add assembly="System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=B77A5C561934E089" />
        <add assembly="System.Drawing.Design, Version=4.0.0.0, Culture=neutral, PublicKeyToken=B03F5F7F11D50A3A" />
      </assemblies>
    </compilation>
 
    <httpHandlers>
      <add path="Telerik.Web.UI.DialogHandler.aspx" verb="*" type="Telerik.Web.UI.DialogHandler, Telerik.Web.UI, Culture=neutral, PublicKeyToken=121fae78165ba3d4" validate="false" />
      <add path="Telerik.Web.UI.SpellCheckHandler.axd" verb="*" type="Telerik.Web.UI.SpellCheckHandler, Telerik.Web.UI, Version=2008.3.1314.35, Culture=neutral, PublicKeyToken=121fae78165ba3d4" validate="false" />
      <add path="Telerik.RadUploadProgressHandler.ashx" verb="*" type="Telerik.Web.UI.RadUploadProgressHandler, Telerik.Web.UI" />
 </httpHandlers>

Bold line is highlighted in red when error occurs, I had copied file Telerik.Web.UI.dll to bin.

Thanks in advance.

Steve
 

Steve
Top achievements
Rank 1
 answered on 29 Nov 2010
3 answers
100 views
Hello,
             I have a radtooltip inside a usercontrol, I put the user control inside another radpane. When the tooltip shows up it shows only part of it and the rest is hidden behind the radpane. Is there a way to show the tooltip on top?..

Thanks,
Bharani
Bharani Mani
Top achievements
Rank 1
 answered on 29 Nov 2010
3 answers
673 views

Problem 1:
I have found a link on how to adjust the width of declaritive columns through code behind:
http://www.telerik.com/help/aspnet-ajax/grdusingcolumns.html

protected void RadGrid1_PreRender(object sender, System.EventArgs e)
{
 foreach(GridColumn column in RadGrid1.Columns)
 {
   if (column.UniqueName == "BirthDate")
   {
     (column as GridBoundColumn).ReadOnly = true;
     (column as GridBoundColumn).DataFormatString = "{0:D}";
     break;
   }
 }
 RadGrid1.Rebind();
}  

Although, when I use rebind() as in the example, the detailtable expand button stops working in my grid. When it is clicked the grid rebinds again and the rows never expand.
How do I get the Expand to work after implementing the above code?

Problem 2: How do I set the width of the columns in the code behind for the Detailtable? Can you please provide a simple example. Is it done in the PreRender event? Will I need to rebind the Detailtable as well?

Thanks so much for your time,
Kellie

Pavlina
Telerik team
 answered on 29 Nov 2010
5 answers
173 views
Hi all,

I have a grid that contains 8 charts and want to export this to pdf.
Following the thread http://www.telerik.com/community/forums/aspnet/grid/exception-on-pdf-export-from-grid.aspx, I've replaced the charts by .png images before.

So I have 8 .png - images, each of it has a file size of around 15KB.

When exporting this grid to pdf, the resulting document has 4 pages and a file size of around 4MB !!!
This is way too big.

I've checked the pdf export settigns and did not see anything like "DPI resolution" or "render quality" etc.
So: is there any possibility to render a grid that contains 120KB image data into a document less than 4MB?

I had another grid export containing only text, this one is only 9KB big...

greetings,
  Bernd

btw.: I'm using RadControls for Asp .Net Ajax Q1/2009
Bernd
Top achievements
Rank 1
 answered on 29 Nov 2010
2 answers
228 views
Hi,
Is any cleverly way to prepare a list of opened RadWindows and alway shows it in application (e.g. in any corner of a website)?

Thanks.
wnl
Top achievements
Rank 1
 answered on 29 Nov 2010
11 answers
267 views
I have a instance where I have a calendar that groups multiple resources together.  I added the context menu to the calendar for inserts.  When I trigger the insert command in Week or Month view the timeslot variable loads properly based on the parameters that are passed from the client script.  But when I attempt to trigger the insert command when the Day view is selected I get a IndexOutOfRangeException.  Cell index out of range: 4.

The views are setup as follows:
  • Daily: GroupBy = Room, GroupDirection = Horizontal
  • Week: GroupBy = Room, GroupDirection = Vertical
  • Month: GroupBy = ""

Code:
        Dim requestParams() As String = e.Argument.Split(Microsoft.VisualBasic.ChrW(32))  
        Dim target As String = requestParams(0)  
        Dim command As String = requestParams(1)  
        If (target = "TimeSlot"Then  
            If (command = "Insert"Then  
                Dim index As String = requestParams(2)  
  
                Dim timeSlot As ISchedulerTimeSlot = rsEvent.GetTimeSlotFromIndex(index)  
                ^---Exception when in Day view---^  

Exception:
System.IndexOutOfRangeException was unhandled by user code
  Message="Cell index out of range: 4"
  Source="Telerik.Web.UI"
  StackTrace:
       at Telerik.Web.UI.Scheduler.Views.Week.Model.GetSlotByIndex(String index)
       at Telerik.Web.UI.Scheduler.Views.Week.GroupedByResource.Model.GetSlotByIndex(String index)
       at Telerik.Web.UI.RadScheduler.GetTimeSlotFromIndex(String index)
       at Pages_Main.RadAjaxManager1_AjaxRequest(Object sender, AjaxRequestEventArgs e) in c:\inetpub\wwwroot\Scheduler\Pages\Main.aspx.vb:line 66
       at Telerik.Web.UI.RadAjaxControl.OnAjaxRequest(AjaxRequestEventArgs args)
       at Telerik.Web.UI.RadAjaxControl.RaisePostBackEvent(String eventArgument)
       at System.Web.UI.Page.RaisePostBackEvent(IPostBackEventHandler sourceControl, String eventArgument)
       at System.Web.UI.Page.RaisePostBackEvent(NameValueCollection postData)
       at System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint)

Mike
Top achievements
Rank 1
 answered on 29 Nov 2010
Narrow your results
Selected tags
Tags
+? more
Top users last month
Rob
Top achievements
Rank 3
Bronze
Bronze
Iron
Sergii
Top achievements
Rank 1
Iron
Iron
Iron
Dedalus
Top achievements
Rank 1
Iron
Iron
Lan
Top achievements
Rank 1
Iron
Doug
Top achievements
Rank 1
Want to show your ninja superpower to fellow developers?
Top users last month
Rob
Top achievements
Rank 3
Bronze
Bronze
Iron
Sergii
Top achievements
Rank 1
Iron
Iron
Iron
Dedalus
Top achievements
Rank 1
Iron
Iron
Lan
Top achievements
Rank 1
Iron
Doug
Top achievements
Rank 1
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?