Telerik Forums
UI for ASP.NET AJAX Forum
1 answer
143 views
Hi,

Im using Telerik 2010.2.713 version with Sharepoint 2010.
Created visualwebpart with simple button, 1 radcombobox inside updatepanel, initially the radcombobox will be visible false, on button click we are trying to enable the radcombobox.
But when i click on button im getting error on page 'Telerik is undefined', so i changed my web.config with Telerik.Web.UI.WebResource in <handlers>, later on im getting 'Object expected'.

Please find the below code that im using

visual webpart usercontrol

<asp:UpdatePanel runat="server" ID="updatePanel1" UpdateMode="Conditional" >
    <ContentTemplate>
        <asp:Button runat="server" ID="btn1" Text="ShowButton" OnClick="btn1_Click" />
        <telerik:RadComboBox visible="false" AutoPostBack="true" ID="RadComboBox1" runat="server">
            <Items>
                <telerik:RadComboBoxItem Text="1" />
                <telerik:RadComboBoxItem Text="2" />
                <telerik:RadComboBoxItem Text="3" />
            </Items>
        </telerik:RadComboBox>
    </ContentTemplate>
</asp:UpdatePanel>

Telerik references in Web.Config

<httpHandlers>
      <remove verb="*" path="*.asmx" />
      <add verb="*" path="*.asmx" validate="false" type="System.Web.Script.Services.ScriptHandlerFactory, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" />
      <add verb="*" path="*_AppService.axd" validate="false" type="System.Web.Script.Services.ScriptHandlerFactory, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" />
      <add verb="GET,HEAD" path="ScriptResource.axd" validate="false" type="System.Web.Handlers.ScriptResourceHandler, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" />
      <add path="Telerik.Web.UI.WebResource.axd" type="Telerik.Web.UI.WebResource" verb="*" validate="false" />
    </httpHandlers>

<handlers>
      <remove name="OPTIONSVerbHandler" />
      <remove name="WebServiceHandlerFactory-Integrated" />
      <remove name="svc-Integrated" />
      <remove name="WebDAV" />
      <add name="svc-Integrated" path="*.svc" verb="*" type="System.ServiceModel.Activation.HttpHandler, System.ServiceModel, Version=3.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" preCondition="integratedMode" />
      <add name="OwssvrHandler" scriptProcessor="C:\Program Files\Common Files\Microsoft Shared\Web Server Extensions\14\isapi\owssvr.dll" path="/_vti_bin/owssvr.dll" verb="*" modules="IsapiModule" preCondition="integratedMode" />
      <add name="ScriptHandlerFactory" verb="*" path="*.asmx" preCondition="integratedMode" type="System.Web.Script.Services.ScriptHandlerFactory, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" />
      <add name="ScriptHandlerFactoryAppServices" verb="*" path="*_AppService.axd" preCondition="integratedMode" type="System.Web.Script.Services.ScriptHandlerFactory, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" />
      <add name="ScriptResource" preCondition="integratedMode" verb="GET,HEAD" path="ScriptResource.axd" type="System.Web.Handlers.ScriptResourceHandler, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" />
      <add name="JSONHandlerFactory" path="*.json" verb="*" type="System.Web.Script.Services.ScriptHandlerFactory, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" resourceType="Unspecified" preCondition="integratedMode" />
      <add name="ReportViewerWebPart" verb="*" path="Reserved.ReportViewerWebPart.axd" type="Microsoft.ReportingServices.SharePoint.UI.WebParts.WebPartHttpHandler, Microsoft.ReportingServices.SharePoint.UI.WebParts, Version=10.0.0.0, Culture=neutral, PublicKeyToken=89845dcd8080cc91" />
      <add name="ReportViewerWebControl" verb="*" path="Reserved.ReportViewerWebControl.axd" type="Microsoft.Reporting.WebForms.HttpHandler, Microsoft.ReportViewer.WebForms, Version=8.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" />
      <add name="Telerik.Web.UI.WebResource" verb="*" preCondition="integratedMode" path="Telerik.Web.UI.WebResource.axd" type="Telerik.Web.UI.WebResource" />
    </handlers>

please help me to resolve the issue asap, waiting for ur reponse
Thanks in advance
PJ
Top achievements
Rank 1
 answered on 23 Feb 2014
2 answers
168 views
Hi, i have a RadContextMenu which is created dynamically.The RadMenuItem inside it is also created dynamically.
My RadMenuItem which may consists of Edit/ Delete/Firm.When user click on the Firm or Delete , a pop up come out for confirmation. When user choose ok only, then it proceed to firm or delete the record.

My problem is no matter user click on the ok or cancel button the  RadMenu.ItemClick evet is fired.
Does anyone has idea on this??
Below is my coding :
    Private Sub CreateDynamicControl() 
 
        Dim i As Integer 
        Dim iCellIndex As Integer 
        Dim drFoundRecord As Data.DataRow() 
 
        Try 
 
            For i = 0 To gvDynamic.Rows.Count - 1 
                For iCellIndex = 1 To gvDynamic.Rows(i).Cells.Count - 1 
                    If gvDynamic.Rows(i).Cells(iCellIndex).ID Is Nothing = False Then 
 
                        Dim cLabelItem As New Label 
                        Dim cTxtboxQty As New TextBox 
                        Dim cLabelWorkOrder As New Label 
                        Dim cTxtWorkOrder As New TextBox 
 
                        Dim cLiteraSpace1 As New LiteralControl 
                        Dim cLiteraSpaceBR As New LiteralControl 
                        Dim cLiteraSpace2 As New LiteralControl 
                        Dim cHtmlTable As New HtmlTable 
 
                        Dim radMenu As New Telerik.Web.UI.RadContextMenu 
                        Dim radMenuItem As New Telerik.Web.UI.RadMenuItem 
                        Dim radMenuItem2 As New Telerik.Web.UI.RadMenuItem 
                        Dim radMenuItem3 As New Telerik.Web.UI.RadMenuItem 
                        Dim target As New Telerik.Web.UI.ContextMenuControlTarget 
 
 
 
 
                        Dim button1 As New Button 
 
 
                        drFoundRecord = getRecordByKey(gvDynamic.Rows(i).Cells(iCellIndex).ID) 
 
                        If drFoundRecord.Length > 0 Then 
 
                            cHtmlTable = CreateDynamicHTMLTable() 
 
                            gvDynamic.Rows(i).Cells(iCellIndex).BackColor = Drawing.Color.BlanchedAlmond 
 
                            cLabelItem.ID = "lblItem" & gvDynamic.Rows(i).Cells(iCellIndex).ID 
                   
                            cLabelItem.Text = drFoundRecord(0)("Planned_Item") 
                          
                            radMenuItem.Text = "Edit" 
                            radMenuItem2.Text = "Delete" 
                            radMenuItem3.Text = "Firm" 
 
                            radMenu.Items.Add(radMenuItem) 
                            radMenu.Items.Add(radMenuItem2) 
                            radMenu.Items.Add(radMenuItem3) 
 
                            radMenuItem3.Attributes.Add("onclick", "return confirm('Are you sure you want to firm?');") 
                            radMenuItem2.Attributes.Add("onclick", "return confirm('Are you sure you want to delete?');") 
 
                            AddHandler radMenu.ItemClick, AddressOf cRadMenuItem1Click 
 
                            target.ControlID = cLabelItem.ID 
 
                            radMenu.Targets.Add(target) 
 
 
                            cHtmlTable.Rows(0).Cells(0).Controls.Add(radMenu) 
                            cHtmlTable.Rows(0).Cells(0).Controls.Add(cLabelItem) 
                
                            gvDynamic.Rows(i).Cells(iCellIndex).Controls.Add(cHtmlTable) 
 
                        End If 
 
                    End If 
                Next 
            Next 
        Catch ex As Exception 
            Throw ex 
        End Try 
 
    End Sub 
 
 
    Protected Sub cRadMenuItem1Click(ByVal sender As Object, ByVal e As Telerik.Web.UI.RadMenuEventArgs) 
 
        Try 
 
            Dim a As String 
            a = "sfds" 
 
 
        Catch ex As Exception 
            Throw ex 
        End Try 
 
    End Sub 
TQ
Silvio Silva Junior
Top achievements
Rank 2
 answered on 22 Feb 2014
3 answers
86 views
Hello,

I need to add detail table in the existing grid, the grid has only mastertableview currently. I am able to add the markup but i am not able to fully understand the code written in NeedsDataSource event. I tried to split the code to detailTable DataBind but it is passing the same DataKeyValueto all the records of the detail table. So please help me to do this. I have provided the grdfilesParent Design markup and the code in NeedDataSource Event. and also the STGrdNotesMaster grid design markup, like this i need to change the grdfilesParent . Help me to convert it.
Existing Grid With Only Master Table
-------------------------------------------
 
<ST:STGrid ID="grdfilesParent" runat="server" Width="100%" AllowPaging="false"
                                        GroupingEnabled="true" ShowGroupPanel="false"  EnableHierarchyExpandAll="true" >
                                        <MasterTableView  HierarchyLoadMode ="Client"  >
                                            <Columns>
                                                <tel:GridBoundColumn UniqueName="Name" DataField="Name" HeaderText="Category" />
                                                <tel:GridHyperLinkColumn UniqueName="Subject" DataTextField="Subject" HeaderText="Subject"
                                                    DataNavigateUrlFormatString="attachments/display.aspx?id={0}" DataNavigateUrlFields="ID"
                                                    SortExpression="Subject">
                                                    <ItemStyle CssClass="gridhyperlink" />
                                                </tel:GridHyperLinkColumn>
                                                <tel:GridHyperLinkColumn UniqueName="FileName" DataTextField="FileName" HeaderText="Attachment"
                                                    DataNavigateUrlFormatString="{0}" DataNavigateUrlFields="AttachmentUrl" SortExpression="FileName"
                                                    Target="_blank">
                                                    <ItemStyle CssClass="gridhyperlink" />
                                                </tel:GridHyperLinkColumn>
                                                <tel:GridDateTimeColumn UniqueName="CreatedDate" DataField="CreatedDate" HeaderText="Date" />
                                                <tel:GridBoundColumn UniqueName="CreatedBy" DataField="CreatedBy" HeaderText="Author" />
                                            </Columns>
                                            <GroupByExpressions>
                                                <tel:GridGroupByExpression>
                                                    <SelectFields>
                                                        <tel:GridGroupByField FieldName="Name" FieldAlias="Category"  />
                                                    </SelectFields>
                                                    <GroupByFields>
                                                        <tel:GridGroupByField FieldName="Name" />
                                                    </GroupByFields>
                                                </tel:GridGroupByExpression>
                                            </GroupByExpressions>
                                        </MasterTableView>
                                        <ClientSettings AllowExpandCollapse="true">
                                         </ClientSettings>
            </ST:STGrid>
---------------------------------------------------
NeedDataSource Event of Above Grid:
--------------------------------------------
Private Sub grdfilesParent_NeedsDataSource(ByVal sender As Object, ByVal e As GridNeedDataSourceEventArgs) Handles grdAttachmentsParent.NeedDataSource
        Dim types As fileTypeList = CurrentST.GetfileTypes()
        Dim attachments = types.Aggregate(
         New List(Of Object)(),
         Function(acc As List(Of Object), type As STfileType)
             Dim typefilements As STfilementList = Document.Getfilements(type.ID)
             typefilements.Aggregate(
              acc,
              Function(acc2 As List(Of Object), filement As STfile)
                  Dim extension = file.Extension.ToLower()
                  Dim navigationUrl As String = String.Empty
 
                  If CurrentSTClient.av Then
                      navigationUrl = String.Format("files/view.aspx?id={0}&path={1}&aid={2}", file.Document.ID, file.FileName, file.ID)
                  ElseIf EnableCommentsWithfiles Then
                      navigationUrl = String.Format("reviews/displayReadOnlyOptional.aspx?id={0}&type=file&path={1}&aid={2}", file.Document.ID, file.FileName, file.ID)
                  Else
                      If (extension = "docx" _
                       OrElse extension = "doc" _
                       OrElse extension = "dotx" _
                       OrElse extension = "dot" _
                       OrElse extension = "rtf" _
                       OrElse extension = "xls" _
                       OrElse extension = "xlsx" _
                      ) Then
                          navigationUrl = String.Format(
                           "reviews/displayreadonly.aspx?id={0}&type=file&path={1}",
                           file.ID,
                           file.FileName
                          )
                      Else
                          navigationUrl = file.VirtualPath
                      End If
                  End If
 
                  acc2.Add(New With {
                   Key .Name = type.Name,
                 .ID = file.ID,
                 .Subject = file.Subject,
                 .FileName = file.FileName,
                 .CreatedDate = String.Format("{0} {1}", file.CreatedDate.ToString(CurrentCulture.DateTimeFormat.ShortDatePattern, CurrentCulture), file.CreatedDate.ToString(CurrentCulture.DateTimeFormat.ShortTimePattern, CurrentCulture)),
                 .CreatedBy = file.CreatedBy,
                  .fileUrl = navigationUrl
                  })
                  Return acc2
              End Function
             )
             Return acc
         End Function
        )
 
 
        DirectCast(grdAttachmentsParent.Columns(1), GridHyperLinkColumn).DataNavigateUrlFormatString = String.Format("{0}cc/files/display.aspx?id={1}0{2}", Captions.VirtualRoot, Chr(123), Chr(125))
 
        grdfilesParent.DataSource = files.ToArray()
 
End Sub
---------------------------------------------
 
I need to convert the above grid to  the Grid like below with Master - Detail
-----------------------------------------------------------------------------------------
<ST:STGrid ID="STGrdNotesMaster" runat="server" TabIndex="212" AutoGenerateColumns="false" AllowSorting="false" AllowPaging="false" ClientSettings-AllowColumnsReorder="false" ClientSettings-AllowDragToGroup="false" ShowGroupPanel="false" EnableHierarchyExpandAll="true" MasterTableView-ExpandCollapseColumn-HeaderStyle-BackColor="LightGray" >
                                            <MasterTableView DataKeyNames="ID" HierarchyDefaultExpanded="false" NoMasterRecordsText="" NoDetailRecordsText="" GroupLoadMode="Client" HierarchyLoadMode ="Client" >
                                                <Columns>
                                                    <telerik:GridBoundColumn HeaderText="Category" DataField="Name" UniqueName="Category" />
                                                    <telerik:GridTemplateColumn UniqueName="Reorder">
                                                        <ItemTemplate><ST:STButton ID="btnReorder" runat="server" CommandName="reorder" Text="Reorder based on sort" /></ItemTemplate>
                                                    </telerik:GridTemplateColumn>
                                                </Columns>
                                                <DetailTables>
                                                    <telerik:GridTableView Name="Detail" AllowSorting="true" AllowPaging="false" DataKeyNames="ID" NoMasterRecordsText="" NoDetailRecordsText="" EditMode="InPlace">
                                                        <Columns>
                                                            <telerik:GridHyperLinkColumn UniqueName="Subject" HeaderText="Subject" DataNavigateUrlFormatString="~/notedisplay.aspx?id={0}" DataNavigateUrlFields="ID" DataTextField="Subject" SortExpression="Subject" ItemStyle-CssClass="gridhyperlink" HeaderStyle-Width="500px" />
                                                            <telerik:GridHyperLinkColumn UniqueName="file" HeaderText="file" DataNavigateUrlFormatString="javascript:void(window.open('imageviewer.aspx?a=3&b=file&c={0}', '_blank', 'left=0, top=0, width=785, height=585, titlebar=yes, location=no, status=no, toolbar=no, menubar=no, scrollbars=no, resizable=yes'));" DataNavigateUrlFields="ID" DataTextField="fileName" SortExpression="fileName" ItemStyle-CssClass="gridhyperlink" />
                                                            <telerik:GridBoundColumn UniqueName="AddDate" HeaderText="Created" DataField="AddDate" SortExpression="AddDate" ReadOnly="true" />
                                                            <telerik:GridEditCommandColumn UniqueName="EditColumn">
                                                                <ItemStyle CssClass="gridhyperlink" />
                                                            </telerik:GridEditCommandColumn>
                                                        </Columns>
                                                    </telerik:GridTableView>
                                                </DetailTables>
                                            </MasterTableView>
                                            <ClientSettings AllowExpandCollapse="true">
                                            </ClientSettings>
                                        </ST:STGrid>
Joselina
Top achievements
Rank 1
 answered on 21 Feb 2014
0 answers
68 views
The application is doing unknown timeout even if working on the application.We have done the manual alert & session out using JavaScript with the following code. We are using the RadWindow from telerik in the application. But this code is not able to attach the mousemove, keydown & click events from the radwindow popup.Even if we are working on the application we get an alert for timeout. Can anyone help with this problem? 

// Function to Open Any Generic Window Popup
function OpenRadWind(URL, HorzLength, VertLength, MoveToLeft, MoveToTop) {
RadWindow1 = new window.radopen(URL, "RadWindow");
RadWindow1.setUrl(RadWindow1.get_navigateUrl());
RadWindow1.set_visibleStatusbar(true);
RadWindow1._showContentDuringLoad = false;
RadWindow1.maximize();
//TimeOut Function
attachEvent(RadWindow1.GetContentFrame().contentWindow, 'mousemove', resetTimer);
attachEvent(RadWindow1.GetContentFrame().contentWindow, 'keydown', resetTimer);
attachEvent(RadWindow1.GetContentFrame().contentWindow, 'click', resetTimer);
return false;
}function resetTimer() {
var idleSeconds = 10;
var idleTimer;
clearTimeout(idleTimer);
idleTimer = setTimeout(whenUserIdle, idleSeconds * 1000);
}//TimeOut Function
attachEvent(window, 'load', function () {
attachEvent(document.body, 'mousemove', resetTimer);
attachEvent(document.body, 'keydown', resetTimer);
attachEvent(document.body, 'click', resetTimer);
attachEvent(RadWindow1.GetContentFrame().contentWindow, 'mousemove', resetTimer);
attachEvent(RadWindow1.GetContentFrame().contentWindow, 'keydown', resetTimer);
attachEvent(RadWindow1.GetContentFrame().contentWindow, 'click', resetTimer);
resetTimer(); // Start the timer when the page loads
});function whenUserIdle() {
if (window.location.pathname.search("Login.aspx") == -1) {
alert("Your Current Session Is Over");
window.location = window.location.protocol + "//" + window.location.host + "/" + window.location.pathname.split('/')[1] + "/Account/Login.aspx?logout=";
}
}function attachEvent(obj, evt, fnc, useCapture) {
if (obj.addEventListener) {
obj.addEventListener(evt, fnc, !!useCapture);
return true;
} else if (obj.attachEvent) {
return obj.attachEvent("on" + evt, fnc);
}
}
Raman
Top achievements
Rank 1
 asked on 21 Feb 2014
1 answer
352 views
I have a website that has a RadMultiPage control on the main page with 5
UserControls that wrap RadGrid's in each PageView.  Each RadGrid is set up almost identically to the rest, just with different data.  However, you can only successfully scroll the first grid vertically using the mouse scroll wheel.  The other grids have vertical scroll bars, but you can only drag their scroll bars, you can't use the scroll wheel.

Using Firebug to look into this further, it turns out that the scroll bar that works with the mouse wheel is a "VirtualScroll" scroll bar, shown here:
<div id="ctl00_MainContent_TrafficSignalsGridUserControl_RadGridTrafficSignals_GridData" class="rgDataDiv" style="overflow-x: auto; overflow-y: scroll; width: 100%; height: 474px;">
 
<div id="ctl00_MainContent_TrafficSignalsGridUserControl_RadGridTrafficSignals_ctl00_VirtualScroll" style="overflow-y: scroll; position: absolute; right: 0px; top: 0px; width: 18px; height: 458px;">

The first div tag is the RadGrid itself, and the second is the "VirtualScroll" scroll bar.  What's interesting about this is that I don't set the EnableVirtualScrollPaging
 attribute to true on any of the Grids.  The other RadGrids have a scroll bar that is inside the outer RadGrid div and is not an external div as shown above.  Here is the markup for the first grid that scrolls successfully using the VirtualScroll scrollbar and the scroll wheel:

<telerik:RadGrid ID="RadGridTrafficSignals" runat="server" 
        CssClass="gridClass"
        GridLines="None"
        AutoGenerateColumns="False"
        AllowSorting="True"
        EnableHeaderContextMenu="True"
        Width="98%" Height="636px"
        OnNeedDataSource="RadGridTrafficSignals_NeedDataSource"
        OnUpdateCommand="RadGridTrafficSignals_OnUpdateCommand"
        OnItemUpdated="RadGridTrafficSignals_ItemUpdated"
        OnDataBound="RadGridTrafficSignals_DataBound"
        OnItemCommand="RadGridTrafficSignals_ItemCommand"
        OnItemCreated="RadGridTrafficSignals_OnItemCreated"
        CellSpacing="0"
        AllowFilteringByColumn="True"
        ShowGroupPanel="True"
        ShowStatusBar="False">
        <ClientSettings AllowColumnsReorder="True" AllowDragToGroup="True" ReorderColumnsOnClient="True">
            <ClientEvents OnRowClick="RowClick" OnRowDblClick="RowDblClick" OnGridCreated="GridCreated" OnCommand="GridCommand"></ClientEvents>
            <Scrolling AllowScroll="True" UseStaticHeaders="True" EnableVirtualScrollPaging SaveScrollPosition="True" ScrollHeight="458px"></Scrolling>
    <Virtualization
        EnableVirtualization="true"
        ItemsPerView="100"
        LoadingPanelID="RadAjaxLoadingPanel1" />
        </ClientSettings>
...
</telerik:RadGrid>

 And here is the markup for one of the RadGrid's on which vertical scrolling with the scroll wheel doesn't work:

<telerik:RadGrid ID="RadGridDetectors" runat="server"
        CssClass="gridClass"
        GridLines="None"
        AutoGenerateColumns="False"
        AllowSorting="True"
        EnableHeaderContextMenu="True"
        Width="98%" Height="636px"
        OnNeedDataSource="RadGridDetectors_NeedDataSource"
        OnUpdateCommand="RadGridDetectors_OnUpdateCommand"
        OnItemUpdated="RadGridDetectors_ItemUpdated"
        OnDataBound="RadGridDetectors_DataBound"
        OnItemCommand="RadGridDetectors_ItemCommand"
        OnItemCreated="RadGridDetectors_OnItemCreated"
        CellSpacing="0"
        AllowFilteringByColumn="True"
        ShowGroupPanel="True"
        ShowStatusBar="False">
        <ClientSettings AllowColumnsReorder="True" AllowDragToGroup="True" ReorderColumnsOnClient="True">        
          <ClientEvents OnRowClick="RowClick" OnRowDblClick="RowDblClick" OnGridCreated="GridCreated" OnCommand="GridCommand" />
          <Scrolling AllowScroll="True" UseStaticHeaders="True" SaveScrollPosition="True" ScrollHeight="458px" />
              <Virtualization
                EnableVirtualization="true"
                ItemsPerView="100"
                LoadingPanelID="RadAjaxLoadingPanel1" />
</ClientSettings>

I'm stuck on what to do to resolve this, any help you can provide would be greatly appreciated!

-Chris
Galin
Telerik team
 answered on 21 Feb 2014
4 answers
129 views
I upgraded to the latest Telerik UI version, Q3 2013 SP2 (2013.3.1324), and now all the scheduler items have two resize handles, one on the left and another on the right. The element is a div of class "rsAptResize rsAptResizeStart" and "rsAptResize rsAptResizeEnd".

Is there a setting to turn these off, rather than do it with styles?


Thanks,
Robert
Robert Helm
Top achievements
Rank 1
 answered on 21 Feb 2014
2 answers
85 views
Dear,

We use the rad grid with a context menu (which works fine). Now we should be
able to make the context menu dependable on the clicked row. Fe, we have a
status field in the grid. If the status field equals 'pending' we should see 3
options. If the status filed equals completed we should see 4 menu options, if
the status field is null we should see one option.

Is this achievable with the context menu? If yes, how can we do this?

Thx!

MDS
Top achievements
Rank 1
 answered on 21 Feb 2014
10 answers
343 views
Hi,

I have been using Twitter Bootstrap 2.3.2 and 3.0  on one of the  asp.net web application. Are Telerik controls
responsive to different devices from Mobile, Tablet?  



My company owns Telerik
AJAX UI controls which they just renewed and wondering if using Telerik control
will work with Bootstrap and be responsive to different devices?



Thanks

Ivan Zhekov
Telerik team
 answered on 21 Feb 2014
4 answers
261 views
Hi,

I have a RadGrid in batch mode that contains a RadComboBox inside the EditTemplate.  If I change the options checked inside the ComboBox, in the first row,  those changes persist in the following rows in editmode, even when I´m assigning different checks inside each of the rows in client side scripts.  SO for example if I uncheck the option for XML, PDF and HTM in the combobox in the first row, and then I try to edit the second row, those options are uncheck, when they should be check, since is a new row, and I'm initializing the combobox values with a hiddenfield.

Grid
<telerik:GridTemplateColumn HeaderText="File Prefix" HeaderStyle-Width="280px" UniqueName="Fileprefix">
                                <ItemTemplate>
                                    <asp:Label runat="server" ID="lbChapterFilePrefix">Prefix</asp:Label>
                                    (<asp:Label runat="server" ID="lblFileTypeXML">xml</asp:Label>,
                                    <asp:Label runat="server" ID="lblFileTypePDF">pdf</asp:Label>,
                                    <asp:Label runat="server" ID="lblFileTypeHTM">html</asp:Label>)
                                    <asp:HiddenField runat="server" ID="hdCurrentFileTypes" />
                                </ItemTemplate>
                                <EditItemTemplate>
                                    <asp:Label runat="server" ID="lbFilePrefix">prefix</asp:Label>
                                    <telerik:RadComboBox Skin="Outlook" runat="server" ID="cbFileType" CheckBoxes="true"
                                        AllowCustomText="false" CheckedItemsTexts="DisplayAllInInput" >
                                        <Items>
                                            <telerik:RadComboBoxItem Text="xml" Value="xml" />
                                            <telerik:RadComboBoxItem Text="pdf" Value="pdf" />
                                            <telerik:RadComboBoxItem Text="htm" Value="htm" />
                                        </Items>
                                    </telerik:RadComboBox>
                                </EditItemTemplate>
                            </telerik:GridTemplateColumn>

JS

<script type="text/javascript" language="javascript">
 
    function SaveGridChanges(sender, args) {
        var grid = $find("<%= rgBookManagement.ClientID  %>");
        grid.get_batchEditingManager().saveChanges(grid.get_masterTableView());
    }
 
    function GetCellValue(sender, args) {
        if (args.get_columnUniqueName() === "Fileprefix") {
            args.set_cancel(true);
            var container = args.get_container();
            //debugger;
            var chapterPrefix = $telerik.findElement(container, "lbChapterFilePrefix").innerHTML;
            var isFileTypeXML = ($telerik.findElementcontainer, "hdCurrentFileTypes").value.toLowerCase().indexOf("xml") >= 0 ? true : false);
            var isFileTypePDF = ($telerik.findElement(container, "hdCurrentFileTypes").value.toLowerCase().indexOf("pdf") >= 0 ? true : false);
            var isFileTypeHTM = ($telerik.findElement(container, "hdCurrentFileTypes").value.toLowerCase().indexOf("htm") >= 0 ? true : false);
            args.set_value(new Prefix(chapterPrefix, isFileTypeXML, isFileTypePDF, isFileTypeHTM));
        }
    }
 
    function SetCellValue(sender, args) {
        if (args.get_columnUniqueName() === "Fileprefix") {
              args.set_cancel(true);
              var container = args.get_container();
              value = args.get_value(),
              isFileTypeXML = value.isFileTypeXML,
              isFileTypePDF = value.isFileTypePDF
              isFileTypeHTM = value.isFileTypeHTM;
              //debugger;
              $telerik.findElement(container, "lblFileTypeXML").style.color = (isFileTypeXML == true ? 'black' : 'red');
              $telerik.findElement(container, "lblFileTypePDF").style.color = (isFileTypePDF == true ? 'black' : 'red');
              $telerik.findElement(container, "lblFileTypeHTM").style.color = (isFileTypeHTM == true ? 'black' : 'red');
        }
    }
 
    function GetEditorValue(sender, args) {
        if (args.get_columnUniqueName() === "Fileprefix") {
              args.set_cancel(true);
              var container = args.get_container();
              var combo = $telerik.findControl(container, "cbFileType");
 
              isFileTypeXML = combo.get_items().getItem(0).get_checked();
              isFileTypePDF = combo.get_items().getItem(1).get_checked();
              isFileTypeHTM = combo.get_items().getItem(2).get_checked();
              //debugger;
              chapterPrefix = $telerik.findElement(container, "lbFilePrefix").innerHTML;
              args.set_value(new Prefix(chapterPrefix, isFileTypeXML, isFileTypePDF, isFileTypeHTM));
        }
    }
 
    function SetEditorValue(sender, args) {
        if (args.get_columnUniqueName() === "Fileprefix") {
            args.set_cancel(true);
            var container = args.get_container();
            var value = args.get_value();
            chapterPrefix = value.chapterPrefix,
            isFileTypeXML = value.isFileTypeXML,
            isFileTypePDF = value.isFileTypePDF,
            isFileTypeHTM = value.isFileTypeHTM;
 
            $telerik.findElement(container, "lbFilePrefix").innerHTML = chapterPrefix;
            var combo = $telerik.findControl(args.get_container(), "cbFileType");
 
            combo.trackChanges();
            //debugger;
            //Check Fields
            combo.get_items().getItem(0).set_checked(isFileTypeXML == true);
            combo.get_items().getItem(1).set_checked(isFileTypePDF == true);
            combo.get_items().getItem(2).set_checked(isFileTypeHTM == true);
 
            combo.commitChanges();
        }
    }
 
    var Prefix = function (chapterPrefix, isFileTypeXML, isFileTypePDF, isFileTypeHTM) {
        this.chapterPrefix = chapterPrefix;
        this.isFileTypeXML = isFileTypeXML;
        this.isFileTypePDF = isFileTypePDF;
        this.isFileTypeHTM = isFileTypeHTM;
    }
 
</script>



<ClientSettings><ClientEvents OnBatchEditGetCellValue="GetCellValue" OnBatchEditGetEditorValue="GetEditorValue"                            OnBatchEditSetCellValue="SetCellValue" OnBatchEditSetEditorValue="SetEditorValue" />                 
<ClientSettings><ClientEvents OnBatchEditGetCellValue="GetCellValue" OnBatchEditGetEditorValue="GetEditorValue"                            OnBatchEditSetCellValue="SetCellValue" OnBatchEditSetEditorValue="SetEditorValue" />                 
Viktor Tachev
Telerik team
 answered on 21 Feb 2014
1 answer
134 views

We have recently implemented the latest version of the RadControls to address issues using the Editor in Chrome. We are using the RadControls in DotNetNuke 7. For the most part, everything seems to be working okay now, however we are having an issue when selecting images in the Image Manager to insert into the Editor. When we click on the image, the Image Manager window closes but the selected image doesn't appear in the Editor. We are seeing a JavaScript error: 

Uncaught TypeError: Object [object Array] has no method 'cloneNode'  - jquery.js:9597

CloneNode seems to be called in the following method:

  case "ImageManager":
            var callbackFunction = function (sender, args) {
                //result holds the image element   
                var result = Telerik.Web.UI.Editor.Utils.getOuterHtml(args.get_value());
                var div = document.createElement("DIV");
                Telerik.Web.UI.Editor.Utils.setElementInnerHtml(div, result);

                //First child must be the image!    
                var img = div.firstChild;
                div.style.overflow = "hidden";
                div.style.width = "1px";
                div.style.height = "1px";

                document.body.appendChild(div);
                //GET THE INSERTED IMAGE WIDTH AND HEIGHT    
                //alert(img.offsetWidth + " -- " + img.offsetHeight);
                img.width = img.offsetWidth;
                img.height = img.offsetHeight;

                editor.pasteHtml(div.innerHTML, "ImageManager");
            };

Any ideas what might be causing this issue? Should the full RadControls work properly in the DNN environment?  












jquery.js:9597
jquery.js:9597
jquery.js:9597
Ianko
Telerik team
 answered on 21 Feb 2014
Narrow your results
Selected tags
Tags
+? more
Top users last month
Hiba
Top achievements
Rank 1
Iron
Iron
Rob
Top achievements
Rank 3
Bronze
Bronze
Iron
Max
Top achievements
Rank 1
Veteran
Iron
Alina
Top achievements
Rank 1
Rakhee
Top achievements
Rank 1
Iron
Iron
Iron
Want to show your ninja superpower to fellow developers?
Top users last month
Hiba
Top achievements
Rank 1
Iron
Iron
Rob
Top achievements
Rank 3
Bronze
Bronze
Iron
Max
Top achievements
Rank 1
Veteran
Iron
Alina
Top achievements
Rank 1
Rakhee
Top achievements
Rank 1
Iron
Iron
Iron
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?