Telerik Forums
UI for ASP.NET AJAX Forum
1 answer
105 views
I'm getting following js error:
innerHTML is null or not an object.
I tried to add a few entries to Custom Links via ToolsFile.xml then my editor completely lost Custom Links functionality.
I can't see Custom Links dropdown, instead it displays an icon. And howevering and clicking on it gives me innerHTML is null or not an object error.

Any suggestions?
Rumen
Telerik team
 answered on 27 Jan 2010
1 answer
134 views
I found that the client side Ajax request of Telerik have a shot delay when fire ajaxRequest event.

Currently I create a  RadGrid with check box. Each time user check on the check box it will update the database using AJAX without server postback so javascript is my choice.
I use prototype.js as my ajax request method and it working fine. Later I found that Telerik got own javascript AJAX request (ajaxRequest) method, I try to standardize my code all with Telerik only so I apply the ajaxRequest onto my code.
Telerik method work fine too, but do not no why the check box got shot delay each time I check on it.
Following code is my javascript use to call server update function. As in the code I only do a minimal changes. When remark the ajaxManager.ajaxRequest(pars)  ,the check box will be normal, else the delay happen.

 protoype.js
function UpdateValue(id,c, val) 
    var url = "fn.aspx"
    var pars = 'fn=u'
    pars = pars + '&' + 'id=' + id + '&c=' + c + '&val=' + val; 
 
    var myAjax = new Ajax.Request( 
        url,  
    { 
        method: 'post',  
        parameters: pars,  
        onComplete: response 
    });        

Telerik ajaxRequest
function UpdateValue(id,c, val) 
    var pars = 'fn=u'
    pars = pars + '&' + 'id=' + id + '&c=' + c + '&val=' + val; 
            
    var ajaxManager = $find("<%= RadAjaxManager1.ClientID %>"); 
    ajaxManager.ajaxRequest(pars);         


sitefinitysteve
Top achievements
Rank 2
Iron
Iron
Veteran
 answered on 27 Jan 2010
1 answer
71 views
I need to sync remote events with scheduled appointments.  End users could be in any timezone.  The remote devices could be in any timezone.  And the application is hosted in a timezone.

End users will use the scheduler to enter appointments.  The application logs events passed to it via webservices.  Is logging the event using UTC (on the remote device) the easiest way to sync the scheduled appointments with the event logs?  Or do I need to do some funky timezone manipulation in the scheduler, with the three possible locations (user, remote device, and server)?

Thanks!
Adrian


Peter
Telerik team
 answered on 27 Jan 2010
1 answer
51 views
I'm using the WebService binding approach for supporting ajax calls to post and efficiently retrieve get just the data for the RadScheduler control as discussed here.

I was wondering if I can still explicitly show and hide the RadAjaxLoadingPanel when data is being fetched via WebService binding and ajax?

What client-side event can I use to know when the ajax fetch has begun and when it has ended?

Would the explicit show and hide code look something like what is shown here?

Is there any way to tell when errors have occurred?

Thanks,
Greg


Peter
Telerik team
 answered on 27 Jan 2010
3 answers
152 views
Hi,

I have a grid that is storing key values using the DataKeyName property on the MasterTableView.

<MasterTableView DataKeyNames="col1, col2, record_timestamp">

Special attention needs to be paid to the record_timestamp value stored in the grid. This value is used for concurrency control and needs to be updated whenever the correponding record is updated.

Consider the following scenario.

(1) Grid loads for the first time. Every row in the grid has the values stored in the DataKeyNames property.
(2) The user updates a drop-down which results in a partial post back to the server and that particular record is updated in the database. This update results in a new value for the record_timestamp.

I need to find a way to update the grid to have this update value for that particular row!

The following code snippet would provide some insight as to how I am coding the method.

Protected Sub ddlCountries_SelectedIndexChanged(ByVal sender As Object, ByVal e As System.EventArgs)  
 
Try  
  Dim dropdown As DropDownList = DirectCast(sender, DropDownList)  
  Dim tc As GridTableCell = DirectCast(dropdown.Parent, GridTableCell)  
  Dim dataItem As GridDataItem = DirectCast(tc.Parent, GridDataItem)  
 
  col1Value = dataItem.GetDataKeyValue("col1")  
  col2Value = dataItem.GetDataKeyValue("col2")  
  recordtimestampValue = dataItem.GetDataKeyValue("record_timestamp")   
 
  ' Update the database and get the new timestamp value  
 
  ' Update the grid item to have the new timestamp value stored in the data keys ?????  
 
  Catch ex As Exception  
 
    ' handle error  
 
  Finally  
 
  End Try  
End Sub 

Thanks,
Manny

Tsvetoslav
Telerik team
 answered on 27 Jan 2010
4 answers
183 views
Hello,

Please have a look at this site . Hier .the borders move once the font becomes bold on Rollover. Is there a was to avoid this shaking borders? Specially here it looks terrible.I have playes for a long time with CSS commands, but without any result. Would be greatful for any hint.

Thanks
Gita
Top achievements
Rank 1
 answered on 27 Jan 2010
4 answers
107 views
To whom it may concern

I have a radwindow that is launched with javascript. It works 100% on my development machine (Vista & IE8). On a machine with Windows XP SP3 with IE8 though, there are some issues.

The radwindow loads okay. Some of the controls within the radwindow though, do not. 

The Combobox does not seem to load correctly when the page loads. When I minimize and then maximise the browser window, the combobox works, but still seems a bit buggy.

Are there known issues with comboboxes contained in a radwindow on IE8 with XP?

Regards
Hanno
____
Below is the html of the page.
<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="ContactHistory.aspx.cs" 
    Inherits="xxx.yyy.UI.ClientService.ContactHistory" %> 
 
<%@ Register Assembly="Telerik.Web.UI" Namespace="Telerik.Web.UI" TagPrefix="telerik" %> 
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> 
<html xmlns="http://www.w3.org/1999/xhtml"
<head runat="server"
    <title></title
</head> 
<body> 
    <form id="form1" runat="server"
    <telerik:RadScriptManager ID="RadScriptManager1" runat="server"
    </telerik:RadScriptManager> 
    <telerik:RadAjaxManager ID="RadAjaxManager1" runat="server" EnablePageHeadUpdate="False" 
        DefaultLoadingPanelID="RadAjaxLoadingPanel1"
        <AjaxSettings> 
            <telerik:AjaxSetting AjaxControlID="NoteType"
                <UpdatedControls> 
                    <telerik:AjaxUpdatedControl ControlID="AddNote" /> 
                    <telerik:AjaxUpdatedControl ControlID="Note" /> 
                </UpdatedControls> 
            </telerik:AjaxSetting> 
            <telerik:AjaxSetting AjaxControlID="AddNote"
                <UpdatedControls> 
                    <telerik:AjaxUpdatedControl ControlID="Note" /> 
                    <telerik:AjaxUpdatedControl ControlID="HistoryList" /> 
                </UpdatedControls> 
            </telerik:AjaxSetting> 
            <telerik:AjaxSetting AjaxControlID="MessageSource"
                <UpdatedControls> 
                    <telerik:AjaxUpdatedControl ControlID="HistoryList" /> 
                </UpdatedControls> 
            </telerik:AjaxSetting> 
            <telerik:AjaxSetting AjaxControlID="HistoryList"
                <UpdatedControls> 
                    <telerik:AjaxUpdatedControl ControlID="HistoryList" /> 
                </UpdatedControls> 
            </telerik:AjaxSetting> 
        </AjaxSettings> 
    </telerik:RadAjaxManager> 
    <asp:Panel ID="Panel1" runat="server"
        <table width="100%"
            <tr> 
                <td> 
                    <asp:Label ID="Label1" runat="server" Text="Note Type:"></asp:Label> 
                </td> 
                <td style="text-align: left;"
                    <telerik:RadComboBox ID="NoteType" runat="server" AutoPostBack="True" OnSelectedIndexChanged="NoteType_SelectedIndexChanged"
                        <Items> 
                            <telerik:RadComboBoxItem Text="-- Select --" Value="0" Selected="true" /> 
                            <telerik:RadComboBoxItem Text="Admin" Value="Admin" /> 
                            <telerik:RadComboBoxItem Text="Inbound" Value="Inbound" /> 
                            <telerik:RadComboBoxItem Text="Outbound" Value="Outbound" /> 
                        </Items> 
                    </telerik:RadComboBox> 
                </td> 
                <td> 
                    <asp:Button ID="AddNote" runat="server" Text="Add Note" OnClick="AddNote_Click" Enabled="False" /> 
                </td> 
            </tr> 
            <tr> 
                <td colspan="3"
                    <telerik:RadEditor ID="Note" runat="server" Height="150" Width="100%" EditModes="Preview"
                        <Tools> 
                            <telerik:EditorToolGroup> 
                                <telerik:EditorTool Name="AjaxSpellCheck" Text="SpellCheck" /> 
                            </telerik:EditorToolGroup> 
                        </Tools> 
                        <Content> 
                         
                        </Content> 
                    </telerik:RadEditor> 
                </td> 
            </tr> 
            <tr> 
                <td colspan="3"
                    &nbsp; 
                </td> 
            </tr> 
            <tr> 
                <td colspan="3"
                    <asp:Panel ID="Panel2" runat="server" GroupingText="Message Filter"
                        <br /> 
                        <table> 
                            <tr> 
                                <td> 
                                    <asp:Label ID="Label2" runat="server" Text="Message Source:"></asp:Label> 
                                </td> 
                                <td> 
                                    <telerik:RadComboBox ID="MessageSource" runat="server" AutoPostBack="True" OnSelectedIndexChanged="MessageSource_SelectedIndexChanged"
                                        <Items> 
                                            <telerik:RadComboBoxItem Value="all" Text="All" /> 
                                            <telerik:RadComboBoxItem Value="call" Text="Call" Selected="true" /> 
                                            <telerik:RadComboBoxItem Value="claim" Text="Claim" /> 
                                        </Items> 
                                    </telerik:RadComboBox> 
                                </td> 
                            </tr> 
                        </table> 
                    </asp:Panel> 
                </td> 
            </tr> 
            <tr> 
                <td colspan="3"
                    <telerik:RadGrid ID="HistoryList" runat="server" DataSourceID="dsContactHistory" 
                        GridLines="None" AutoGenerateColumns="False" Width="100%"
                        <MasterTableView CellSpacing="-1" CommandItemDisplay="Top" DataKeyNames="ContactHistoryID" 
                            DataSourceID="dsContactHistory"
                            <RowIndicatorColumn> 
                                <HeaderStyle Width="20px" /> 
                            </RowIndicatorColumn> 
                            <ExpandCollapseColumn> 
                                <HeaderStyle Width="20px" /> 
                            </ExpandCollapseColumn> 
                            <Columns> 
                                <telerik:GridBoundColumn DataField="ContactHistoryID" DataType="System.Int32" HeaderText="ContactHistoryID" 
                                    ReadOnly="True" SortExpression="ContactHistoryID" UniqueName="ContactHistoryID" 
                                    Visible="false"
                                </telerik:GridBoundColumn> 
                                <telerik:GridBoundColumn DataField="LogDate" DataType="System.DateTime" HeaderText="Log Date" 
                                    SortExpression="LogDate" UniqueName="LogDate" DataFormatString="{0:ddd dd-MMM-yyyy hh:mm}" 
                                    ItemStyle-Wrap="false"
                                    <ItemStyle Wrap="False" /> 
                                </telerik:GridBoundColumn> 
                                <telerik:GridBoundColumn DataField="UserName" HeaderText="User Name" SortExpression="UserName" 
                                    UniqueName="UserName" ItemStyle-Wrap="false"
                                    <ItemStyle Wrap="False" /> 
                                </telerik:GridBoundColumn> 
                                <telerik:GridBoundColumn DataField="Description" HeaderText="Description" SortExpression="Description" 
                                    UniqueName="Description"
                                </telerik:GridBoundColumn> 
                            </Columns> 
                            <CommandItemTemplate> 
                                <table style="width: 100%; text-align: right;"
                                    <tr> 
                                        <td> 
                                            <img style="border: 0px" width="12" height="12" alt="" src="../App_Themes/OTSSTheme/Images/Refresh.gif" /><asp:LinkButton 
                                                ID="LinkButton4" runat="server" CommandName="RebindGrid">Refresh list</asp:LinkButton> 
                                        </td> 
                                    </tr> 
                                </table> 
                            </CommandItemTemplate> 
                        </MasterTableView> 
                    </telerik:RadGrid> 
                    <asp:ObjectDataSource ID="dsContactHistory" runat="server" OldValuesParameterFormatString="original_{0}" 
                        SelectMethod="GetDataByCallDetailIDMessageSource" TypeName="xxx.yyy.Data.FusionDataTableAdapters.ContactHistoryListTableAdapter"
                        <SelectParameters> 
                            <asp:Parameter Name="CallDetailID" Type="Int32" /> 
                            <asp:ControlParameter ControlID="MessageSource" Name="MessageSource" PropertyName="SelectedValue" 
                                Type="String" /> 
                        </SelectParameters> 
                    </asp:ObjectDataSource> 
                </td> 
            </tr> 
        </table> 
    </asp:Panel> 
    <telerik:RadFormDecorator ID="DecorateTelerik" runat="server" Skin="Telerik" /> 
    <telerik:RadAjaxLoadingPanel ID="RadAjaxLoadingPanel1" runat="server"
    </telerik:RadAjaxLoadingPanel> 
    </form> 
</body> 
</html> 
 

Hanno Coetzee
Top achievements
Rank 1
 answered on 27 Jan 2010
2 answers
162 views
hi i have a problem regarding to file explorer...I want to set the icons of the directory , files and shortcuts....how to set the icons??i want to assign different icons to the directory  and i also want to assign different type of icons to the files in it(which would be selected by the user). i would handle the Db my self.Last thing i wana ask is can i assign shortcuts to the contents. like if i have a  folder named as images and it contain a folder image1.jpg and another folder name as Images1 and i want to show image1 in images1 can i do this with shortcuts...



regards
Saad javaid
saad javaid
Top achievements
Rank 1
 answered on 27 Jan 2010
2 answers
405 views
Hi,

I'm using AppointmentDataBound to apply my own cssClasses to scheduler appointments based on their type, status and colour.  The type, status and colour are fields I store in the appointments record in my SQL table.

This all works really well and I get icons based on the appointment type and colours based on their status etc...

My problem occurs after I insert a new appointment.  I get an error 'object variable or with block variable not set' in the AppointmentDataBound code.  I think this is because the dataitem is not available at this point.

This is really stumping me and I just can't seem to get around it.  Here's the code :-


Protected Sub Calendar_AppointmentDataBound(ByVal sender As ObjectByVal e As Telerik.Web.UI.SchedulerEventArgs) Handles Calendar.AppointmentDataBound  
 
        'Grab details about the appointments appearance  
        Dim apptComputer As String = e.Appointment.DataItem("computer_name").ToString  
        Dim apptProject As String = e.Appointment.DataItem("project_name").ToString  
        Dim apptRelease As String = e.Appointment.DataItem("release_name").ToString  
        Dim apptType As Integer = e.Appointment.DataItem("appointment_type").ToString  
        Dim apptColour As String = "White" 
        Dim apptStatus As Integer = e.Appointment.DataItem("Status").ToString  
        Dim strStatus As String = "Scheduled" 
        Dim strCSSClass As String = "rsCategoryBlue" 
 
 
        e.Appointment.Subject = "Project: " & apptProject & Chr(13) & "Release: " & apptRelease & Chr(13) & "Computer: " & apptComputer  
 
        'Grab the appointment colour if it is assigned if not then  
        'leave the setting as white (generic).  
        If e.Appointment.DataItem("colour").ToString() <> "" Then 
            apptColour = e.Appointment.DataItem("colour").ToString()  
        End If 
 
        'apptStatus dictates the text colour of the appointment.  
        '1 - Scheduled = Blue  
        '2 - Failed = Red  
        '3 - Passed = Green  
        Select Case apptStatus  
            Case 1 'Scheduled  
                strStatus = "Scheduled" 
            Case 2 'Failed  
                strStatus = "Failed" 
            Case 3 'Passed  
                strStatus = "Passed" 
        End Select 
 
        'apptColour dictates the background colour of the appointment  
        'apptType dictates the icon displayed in the top left corner of the appointment  
        Select Case apptType  
            Case 1 'Generic Appointment  
            Case 2 'QualityControl  
                strCSSClass = "Quality_" & apptColour & "_" & strStatus & "_AppointmentStyle" 
            Case 3 'CompatibilityCheck  
                strCSSClass = "Compatible_" & apptColour & "_" & strStatus & "_AppointmentStyle" 
            Case 4 'PackageApp  
                strCSSClass = "Package_" & apptColour & "_" & strStatus & "_AppointmentStyle" 
            Case 5 'Release  
                strCSSClass = "Release_" & apptColour & "_" & strStatus & "_AppointmentStyle" 
        End Select 
 
        e.Appointment.CssClass = strCSSClass  
 
 
    End Sub 

Here's the Insert code which works everytime

    Protected Sub Calendar_OnAppointmentInsert(ByVal sender As ObjectByVal e As Telerik.Web.UI.SchedulerCancelEventArgs) Handles Calendar.AppointmentInsert  
 
        Dim sdsProjectAppointments As New SqlDataSource  
        Dim strConnection As String = ConfigurationManager.ConnectionStrings("RR3ConnectionString").ConnectionString  
        Dim myRecurrenceParentID As String = "" 
 
        'Check to see if the appointment has a RecurrenceParentID  
        'If so then set the variable if not then leave as "".  Avoids passing null to USP.  
        If e.Appointment.RecurrenceParentID <> Nothing Then 
            'If DirectCast(e.Appointment.RecurrenceParentID, Guid) <> Nothing Then  
            myRecurrenceParentID = e.Appointment.RecurrenceParentID.ToString  
        End If 
 
        sdsProjectAppointments.ConnectionString = strConnection  
        sdsProjectAppointments.InsertCommand = "usp_insert_project_appointment" 
        sdsProjectAppointments.InsertCommandType = SqlDataSourceCommandType.StoredProcedure  
 
        'Set the SQLDataSource Parameters.  The first set of parameters are grabbed from  
        'the new ExceptionAppointment part of the RecurrenceExceptionCreatedEventArgs.  
        'This contains the new records indivdual start and end times etc...  
        sdsProjectAppointments.InsertParameters.Add("Subject", e.Appointment.Subject.ToString)  
        sdsProjectAppointments.InsertParameters.Add("start", e.Appointment.Start.ToString)  
        sdsProjectAppointments.InsertParameters("start").DbType = DbType.DateTime  
        sdsProjectAppointments.InsertParameters.Add("end", e.Appointment.End.ToString)  
        sdsProjectAppointments.InsertParameters("end").DbType = DbType.DateTime  
        sdsProjectAppointments.InsertParameters.Add("recurrencerule", e.Appointment.RecurrenceRule.ToString)  
        sdsProjectAppointments.InsertParameters.Add("recurrenceparentid", myRecurrenceParentID)  
 
        'Now stuff in the parameters we got from our select statement  
        sdsProjectAppointments.InsertParameters.Add("project_guid""00000000-0000-0000-0000-000000000000")  
        sdsProjectAppointments.InsertParameters.Add("parent_project_guid""00000000-0000-0000-0000-000000000000")  
        sdsProjectAppointments.InsertParameters.Add("release_guid""00000000-0000-0000-0000-000000000000")  
        sdsProjectAppointments.InsertParameters.Add("app_env_guid""00000000-0000-0000-0000-000000000000")  
        sdsProjectAppointments.InsertParameters.Add("env_comp_guid""00000000-0000-0000-0000-000000000000")  
        sdsProjectAppointments.InsertParameters.Add("computer_guid""00000000-0000-0000-0000-000000000000")  
        sdsProjectAppointments.InsertParameters.Add("status""1"'Scheduled  
        sdsProjectAppointments.InsertParameters.Add("appointment_type""7"'Type 7 is an informational appointment for the build and release teams  
        sdsProjectAppointments.InsertParameters.Add("colour""White"'Unallocated  
 
        'Call the update method of the SQLDataSource  
        Try 
            sdsProjectAppointments.Insert()  
        Catch ex As Exception  
            MsgBox("An unhandled exception has occurred. " & ex.Message)  
        End Try 
 
    End Sub 
 


After the insert code runs the databound code is called again and any reference to e.appointment.dataitem or even e.appointment.id returns the 'object variable or with block variable not set' error.

Thanks for looking
Jase
Peter
Telerik team
 answered on 27 Jan 2010
3 answers
207 views
Dear Sir,
This Example is the same you have in the online documentation, but it's not working.
please i need this functionality to be able to access the data from the client side.

<telerik:RadListView ID="RadListView1" runat="server" ClientDataKeyNames="ID">  
</telerik:RadListView> 
<telerik:RadCodeBlock ID="RadCodeBlock1" runat="server">  
<script type="text/javascript">  
function GetClientDataKeyValueForFirstItem()   
{  
   var clientDataKeyValues = $find("<%= RadListView1.ClientID %>").get_clientDataKeyValue();  
   var firstItemKeyValue = clientDataKeyValues[0]["ID"];  
}  
</script> 
</telerik:RadCodeBlock>  

note: my telerik version is (2009.3.1016.35)
Regards,
Rosen
Telerik team
 answered on 27 Jan 2010
Narrow your results
Selected tags
Tags
+? more
Top users last month
Simon
Top achievements
Rank 2
Iron
Iron
Bob
Top achievements
Rank 3
Iron
Iron
Veteran
Marco
Top achievements
Rank 4
Iron
Iron
Iron
Grant
Top achievements
Rank 3
Iron
Iron
Iron
Kao Hung
Top achievements
Rank 1
Iron
Want to show your ninja superpower to fellow developers?
Top users last month
Simon
Top achievements
Rank 2
Iron
Iron
Bob
Top achievements
Rank 3
Iron
Iron
Veteran
Marco
Top achievements
Rank 4
Iron
Iron
Iron
Grant
Top achievements
Rank 3
Iron
Iron
Iron
Kao Hung
Top achievements
Rank 1
Iron
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?