Telerik Forums
UI for ASP.NET AJAX Forum
9 answers
586 views
Hi guys,
inside my RadPanelBar I have a RadCombobox and RadTextBox and I need to change background color when control onFocus and when focus leave control onBlur.I tried e few case scenario and did not work:

Please help me.

Thanks so much​
Shinu
Top achievements
Rank 2
 answered on 03 Jul 2014
16 answers
317 views
I am using FireFox 20.0.1 and IE8. We officially support IE8 at work. As a dev, I like FF and Chrome. Using FF and Chrome, everything works fine. When using IE8, the upload process stops right after I select a file. When I do, I get a pulsing yellow dot (instead of solid green) and that's it. 

First, I get and " '$telerik' is undefined" error in the following:

<script language="javascript" type="text/javascript">
   var $ = $telerik.$;
   var uploadsInProgress = 0;
 
   function onFileSelected(sender, args) {
       if (!uploadsInProgress)
           $("#SaveButton").attr("disabled", "disabled");
 
            uploadsInProgress++;
 
            var row = args.get_row();
 
            $(row).addClass("file-row");
        }
 
        function onFileUploaded(sender, args) {
            decrementUploadsInProgress();
        }
 
        function onUploadFailed(sender, args) {
            decrementUploadsInProgress();
        }
 
        function decrementUploadsInProgress() {
            uploadsInProgress--;
 
            if (!uploadsInProgress)
                $("#SaveButton").removeAttr("disabled");
        }
</script>


Which could start off the chain of bad events. Also once I click on the Select button (to choose a file), the "$("#SaveButton").attr("disabled""disabled");" line throws and error saying "Object expected".

Now I think I'm running into some Silverlight issues. The second line in ScriptResource.axd:

if(!a(s).data("cancel")){var t=c[a(s).data("silverlight")];
t.Content.Page.MarshalUploads();


Is giving me the error "System.InvalidOperationException: [ScriptObject_InvokeFailed]
Arguments: 
Debugging resource strings are unavailable. Often the key and arguments provide sufficient information to diagnose the problem. See http://go.microsoft.com/fwlink/?linkid=106663&Version=8.1.20125.0&File=System.Windows.Browser.dll&Key=ScriptObject_InvokeFailed
   at System.Windows.Browser.ManagedObjectInfo.Invoke(ManagedObject obj, InvokeType invokeType, String memberName, ScriptParam[] args)
   at System.Windows.Hosting.ManagedHost.InvokeScriptableMember(IntPtr pHandle, Int32 nMemberID, Int32 nInvokeType, Int32 nArgCount, ScriptParam[] pArgs, ScriptParam& pResult, ExceptionInfo& pExcepInfo)".

Then, most importantly, I receive the following error: "Microsoft JScript runtime error: Unhandled Error in Silverlight Application [ScriptObject_InvokeFailed]
Arguments: 
Debugging resource strings are unavailable. Often the key and arguments provide sufficient information to diagnose the problem. See http://go.microsoft.com/fwlink/?linkid=106663&Version=8.1.20125.0&File=System.Windows.Browser.dll&Key=ScriptObject_InvokeFailed   at System.Windows.Browser.ScriptObject.Invoke(String name, Object[] args)
   at UploadPrototype.EventManager.FilesSelected(Int32 filesCount)
   at UploadPrototype.MainPage.OpenDialog()
   at UploadPrototype.MainPage.OnMouseLeftButtonUp(MouseButtonEventArgs e)
   at System.Windows.Controls.Control.OnMouseLeftButtonUp(Control ctrl, EventArgs e)
   at MS.Internal.JoltHelper.FireEvent(IntPtr unmanagedObj, IntPtr unmanagedObjArgs, Int32 argsTypeIndex, Int32 actualArgsTypeIndex, String eventName, UInt32 flags)".

It's clear that because I'm using IE8, the control is degrading down to Silverlight but is having a problem with that. I don't understand why since I have Silverlight 5.1 installed. I'm not sure what the problem is or what to do about it. 

Thanks!

Justin
Top achievements
Rank 1
 answered on 02 Jul 2014
4 answers
535 views
Hello,

I have a RadHtmlChart Bar chart that is using an ObjectDataSource  to bind data.  The Xaxis is customer name and I'd like to make the customer name a clickable link that would redirect the user to a customer page.  Is this possible?

I've been able to make the bars clickable using javascript for the OnClientSeriesClicked event but my requirements are to make the labels into link.  Any advise would be appreciated

Below is my chart:

<telerik:RadHtmlChart runat="server" ID="BarChart" Height="400" Transitions="true" DataSourceID="ChartsDataSource" OnClientSeriesClicked="OnClientSeriesClicked">
            <PlotArea>
                <Appearance>
                    <FillStyle BackgroundColor="#c5d291"></FillStyle>
                </Appearance>
                 <Series>
                    <telerik:BarSeries DataFieldY="PercentPaid">
                        <Appearance FillStyle-BackgroundColor="#729021"></Appearance>
                        <LabelsAppearance Position="InsideBase" Color="White">
                            <ClientTemplate>
                                $#=dataItem.PaidToDate#
                            </ClientTemplate>
                        </LabelsAppearance>
                    </telerik:BarSeries>
                </Series>
                <XAxis DataLabelsField="CustomerName" Reversed="false" >
                    <TitleAppearance Text="Customer Name" Visible="false">
                        <TextStyle Margin="20" />
                    </TitleAppearance>
                    <MajorGridLines Visible="false" Width="0" />
                    <MinorGridLines Visible="false" />
                </XAxis>
                <YAxis AxisCrossingValue="0" Color="#b3b3b3" MajorTickSize="1" MajorTickType="Outside"
             MinorTickSize="1" MinorTickType="Outside" MinValue="0" MaxValue="100" Reversed="false">
                   <LabelsAppearance DataFormatString="{0}%" RotationAngle="30" Skip="0" ></LabelsAppearance>
                   <MajorGridLines Color="#EFEFEF" Width="0"></MajorGridLines>
                   <MinorGridLines Color="#F7F7F7" Width="0"></MinorGridLines>
                   <TitleAppearance Position="Center" RotationAngle="0" Text="Percent Paid" ></TitleAppearance>
                </YAxis>              
            </PlotArea>
        </telerik:RadHtmlChart>
Dave
Top achievements
Rank 1
 answered on 02 Jul 2014
1 answer
141 views
I have run into a problem with exporting from a RadGrid. Whenever I export from the RadGrid, I have to turn off the AJAX. I download the file fine, but the webpage becomes frozen and I have to refresh the page for it to do anything. I have read a few forum posts and applied what they did but to no effect.

Here is what I currently have:

<script type="text/javascript">
    function requestStart(sender, args) {
        if (args.get_eventTarget().indexOf("ExportToExcelButton") >= 0 ||
                args.get_eventTarget().indexOf("ExportToWordButton") >= 0 ||
                args.get_eventTarget().indexOf("ExportToPdfButton") >= 0 ||
                args.get_eventTarget().indexOf("ExportToCsvButton") >= 0 ||
                args.get_eventTarget().indexOf("chkShowInactive") >= 0) {
            setTimeout(removePanel, 10);
            args.set_enableAjax(false);
        }
    }
  
    function removePanel() {
        $telerik.findControl(document, "RadAjaxLoadingPanel1").hide()
    }
</script>


<telerik:RadAjaxManager ID="RadAjaxManager1" DefaultLoadingPanelID="RadAjaxLoadingPanel1" runat="server" ClientEvents-OnRequestStart="requestStart">
                <AjaxSettings>
                    <telerik:AjaxSetting AjaxControlID="chkShowInactive">
                        <UpdatedControls>
                            <telerik:AjaxUpdatedControl ControlID="chkShowInactive"/>
                        </UpdatedControls>
                    </telerik:AjaxSetting>
                    <telerik:AjaxSetting AjaxControlID="rgvSafetyCommittees">
                        <UpdatedControls>
                            <telerik:AjaxUpdatedControl ControlID="rgvSafetyCommittees"/>
                        </UpdatedControls>
                    </telerik:AjaxSetting>
                </AjaxSettings>
            </telerik:RadAjaxManager>
            <telerik:RadAjaxLoadingPanel ID="RadAjaxLoadingPanel1" runat="server" InitialDelayTime="0" MinDisplayTime="500" Transparency="25">
                <div style="background-color: #ffffff; width: 100%; height: 100%">
                    <h1>
                        <br />
                        <b>Loading..</b>
                    </h1>
                </div>
            </telerik:RadAjaxLoadingPanel>
   
I have also tried something like the following to no effect: 

<script type="text/javascript">
    function requestStart(sender, args) {
        if (args.get_eventTarget().indexOf("ExportToExcelButton") >= 0 ||
                args.get_eventTarget().indexOf("ExportToWordButton") >= 0 ||
                args.get_eventTarget().indexOf("ExportToPdfButton") >= 0 ||
                args.get_eventTarget().indexOf("ExportToCsvButton") >= 0 ||
                args.get_eventTarget().indexOf("chkShowInactive") >= 0) {
            setTimeout(removePanel, 10);
            args.set_enableAjax(false);
        }
    }
 
    function removePanel() {
        args.set_enableAjax(true);
    }
</script>


What the first one would do is attempt to manually hide the loading panel. The second one was just guess work. I had to disable the AJAX for it to download the files. I figured if I could wait a few seconds to re-enable the ajax that it would somehow 'fix' it. So far to my knowledge, the setTimeout doesn't really do anything for me in this case. If I remove it the problems still exist though.

Has anyone run into this issue before? My grid is not inside an update panel of any sort.
Alexander
Top achievements
Rank 1
 answered on 02 Jul 2014
4 answers
2.1K+ views
I'm hoping there is a simple fix for this, but I would accept a complicated one after messing around with it for the last week!

I am putting together a module that will drop into a DotNetNuke portal and I'm populating a Telerik RadGrid with data. I have followed every tutorial and example I can find, but the result keeps coming back with "object Object", "null", or "undefined" when I try to get the value of a cell in the selected rows.

I need to:
1) get the value of the "BookingID'" column for each row that is selected
2) pass the value into a url string that opens up in a RadWindow.

I'm trying to do all of this using javascript, but if you know a better way, I'm down for anything at this point.
Here are some of the tutorials and examples I have followed to no avail:

http://stackoverflow.com/questions/761633/select-a-radgrid-row-client-side-inside-radwindows
http://www.telerik.com/help/aspnet/grid/grdgettingcellvaluesforselectedrowsclientside.html
http://www.telerik.com/community/forums/aspnet-ajax/grid/extracting-cell-values-from-radgrid.aspx
http://demos.telerik.com/aspnet-ajax/grid/examples/client/selecting/defaultcs.aspx
http://demos.telerik.com/aspnet-ajax/grid/examples/client/keys/defaultcs.aspx

Here is my current JavaScript and a stripped down radGrid:

function gup(name) {  
        name = name.replace(/[\[]/, "\\\[").replace(/[\]]/, "\\\]");  
        var regexS = "[\\?&]" + name + "=([^&]*)";  
        var regex = new RegExp(regexS);  
        var results = regex.exec(window.location.href);  
        if (results == nullreturn "";  
        else return results[1];  
    }  
        function ShowEditForm() {  
            var tab = gup('tabid')  
            var mid = gup('mid').replace(/#/, '')  
            var masterTableView = $find("perDiemBookingsRadGrid").get_masterTableView();  
            var id = masterTableView.get_selectedItems()[0].getDataKeyValue('BookingID');  
 
            window.radopen("/Default.aspx?tabid=" + tab + "&ctl=multiEdit&mid=" + mid + &BIDs=" + id, "RadWindow3");  
        } 
<telerik:RadGrid ID="perDiemBookingsRadGrid" runat="server" AllowPaging="True" AllowSorting="True" 
           DataSourceID="perDiemBookingsSqlDataSource" GridLines="None" ShowGroupPanel="True" 
           AllowAutomaticDeletes="True" AllowMultiRowSelection="True" Width="800px" AllowAutomaticUpdates="True" 
           AutoGenerateColumns="False" >  
             <MasterTableView DataSourceID="perDiemBookingsSqlDataSource" DataKeyNames="BookingID" 
               CommandItemDisplay="Top">  
                 <CommandItemTemplate>  
                    <div style="padding: 5px 5px;">  
                      <a href="#" onclick="return ShowEditForm();" visible='<%# perDiemBookingsRadGrid.EditIndexes.Count = 0 %>'>  
                      <img style="border: 0px; vertical-align: middle;" alt="" src="/images/Edit.gif" />  
                      Show Edit Form</a> &nbsp;&nbsp;  
                    </div>  
                 </CommandItemTemplate>  
                 <Columns>  
                    <telerik:GridClientSelectColumn Reorderable="False" Resizable="False" ShowSortIcon="False" 
                    UniqueName="column">  
                    </telerik:GridClientSelectColumn>  
                    <telerik:GridBoundColumn DataField="BookingID" UniqueName="BookingID" DataType="System.Int32" 
                     HeaderText="BookingID" ReadOnly="True" SortExpression="BookingID" Visible="False">  
                    </telerik:GridBoundColumn>  
                    <telerik:GridTemplateColumn DataField="CustomerName" HeaderText="Customer" UniqueName="Customer" 
                     EditFormColumnIndex="2" GroupByExpression="GROUP BY CustomerName" SortExpression="CustomerName">  
                    <EditItemTemplate>  
                 </Columns>  
                      <EditFormSettings ColumnNumber="3">  
                          <EditColumn UniqueName="EditCommandColumn1">  
                          </EditColumn>  
                      </EditFormSettings>  
            </MasterTableView>  
            <ClientSettings AllowDragToGroup="True">  
                 <Selecting AllowRowSelect="True"/>  
            </ClientSettings>  
</telerik:RadGrid>  
 
Pavlina
Telerik team
 answered on 02 Jul 2014
1 answer
226 views
Hi,

Is there any way to disable multiple selection of time slots in the control please?

I only want the user to be able to select half hour slots and for them not to be able to extend it past the half hour slot?

Thanks for your help
Nencho
Telerik team
 answered on 02 Jul 2014
6 answers
190 views
Not a big deal, but wizard replaces Web.config with web.config (first letter capital -> small) which in turn causes SVN (at least TortoiseSVN) to act dumb.
Second thing, but I presume that this is a feature not a bug (although for me it's little annoying): Upgrade wizard replaces Telerik handlers in web.config entirely, so every upgrade I have to change from 
type="Telerik.Web.UI.WebResource"
to
type="Telerik.Web.UI.WebResourceSession".


It would be really nice if you could change that..

Jacek

										
Dustin
Top achievements
Rank 1
 answered on 02 Jul 2014
3 answers
80 views
Anybody can help me how to make dynamic  drag and drop between RadGrid? Let say I have 4 RadGrid and I want 1st RadGrid's row to 2nd RadGrid or 3rd RadGrid or 4th RadGrid. As reverse 2nd RadGrid row to 1st or 3rd or 4th RadGrid. I appreciate any reference or tutorial.

Thanks & Best Regards
HAN 
Maria Ilieva
Telerik team
 answered on 02 Jul 2014
1 answer
62 views
Can any body help me why does IE and FireFox cann't fire OnAjaxRequest. But Chrome can work properly . I want to publish my code

ASPX

  <telerik:RadScriptManager ID="RadScriptManager1" runat="server">
                <Scripts>
                    <asp:ScriptReference Assembly="Telerik.Web.UI" Name="Telerik.Web.UI.Common.Core.js" />
                    <asp:ScriptReference Assembly="Telerik.Web.UI" Name="Telerik.Web.UI.Common.jQuery.js" />
                    <asp:ScriptReference Assembly="Telerik.Web.UI" Name="Telerik.Web.UI.Common.jQueryInclude.js" />
                    <asp:ScriptReference Path="~/JavaScripts/lib/jquery-ui-1.10.4.min.js" />
                    <asp:ScriptReference Path="~/JavaScripts/lib/jquery.blockUI.min.js" />
                    <asp:ScriptReference Path="~/JavaScripts/lib/Json2.min.js" />
                </Scripts>
                <Services>
                    <asp:ServiceReference Path="~/Services/ReservationService.asmx" />
                </Services>
            </telerik:RadScriptManager>
            <telerik:RadAjaxManager ID="RadAjaxManager1" runat="server" OnAjaxRequest="RadAjaxManager1_AjaxRequest">
                <AjaxSettings>
                    <telerik:AjaxSetting AjaxControlID="RadAjaxManager1">
                        <UpdatedControls>
                            <telerik:AjaxUpdatedControl ControlID="RadAjaxManager1"/>
                            <telerik:AjaxUpdatedControl ControlID="grdBillingContact" />
                            <telerik:AjaxUpdatedControl ControlID="hdnChkEmptyRow" />
                            <telerik:AjaxUpdatedControl ControlID="grdTrans" />
                            <telerik:AjaxUpdatedControl ControlID="grdLedger1" />
                            <telerik:AjaxUpdatedControl ControlID="grdLedger2" />
                            <telerik:AjaxUpdatedControl ControlID="grdLedger3" />
                            <telerik:AjaxUpdatedControl ControlID="grdLedger4" />
                        </UpdatedControls>
                    </telerik:AjaxSetting>
                    <telerik:AjaxSetting AjaxControlID="grdBillingContact">
                        <UpdatedControls>
                            <telerik:AjaxUpdatedControl ControlID="grdBillingContact" />
                            <telerik:AjaxUpdatedControl ControlID="hdnChkEmptyRow" />
                        </UpdatedControls>
                    </telerik:AjaxSetting>

                    <telerik:AjaxSetting AjaxControlID="grdTrans">
                        <UpdatedControls>
                            <telerik:AjaxUpdatedControl ControlID="grdTrans" />
                        </UpdatedControls>
                    </telerik:AjaxSetting>
                    <telerik:AjaxSetting AjaxControlID="RadTabStrip1">
                        <UpdatedControls>
                            <telerik:AjaxUpdatedControl ControlID="grdBillingContact" />
                            <telerik:AjaxUpdatedControl ControlID="hdnChkEmptyRow" />
                        </UpdatedControls>
                    </telerik:AjaxSetting>
                </AjaxSettings>
                <ClientEvents OnRequestStart ="RequestStart" OnResponseEnd="ResponseEnd" />
            </telerik:RadAjaxManager>


  function onRowDropping(sender, args) {
                    var draggedItems = args.get_draggedItems();
                    var rateKey = null;
                    if (draggedItems.length === 1) {
                        rateKey = draggedItems[0].getDataKeyValue('ReservationRateKey');
                    }
                    var destinationHtmlElement = args.get_destinationHtmlElement();
                    var sender_id = sender.get_id();
                    switch (sender_id) {
                        case 'grdLedger1': {
                            if (isChildOf('<%=grdLedger2.ClientID %>', destinationHtmlElement)) {
                                if (rateKey !== null) {
                                    var cmd = 'UpdateLedger|' + rateKey + '|2';
                                    AjaxRequest(cmd);
                                }
                            }
                            else if (isChildOf('<%=grdLedger3.ClientID %>', destinationHtmlElement)) {
                                    if (rateKey !== null) {
                                        var cmd = 'UpdateLedger|' + rateKey + '|3';
                                        AjaxRequest(cmd);
                                    }
                                }
                                else if (isChildOf('<%=grdLedger4.ClientID %>', destinationHtmlElement)) {
                                    if (rateKey !== null) {
                                        var cmd = 'UpdateLedger|' + rateKey + '|4';
                                        AjaxRequest(cmd);
                                    }
                                }
                                else {
                                    args.set_cancel(true);
                                }
                        }
break;
}
}
 function isChildOf(parentId, element) {
                    while (element) {
                        if (element.id && element.id.indexOf(parentId) > -1) {
                            return true;
                        }
                        element = element.parentNode;
                    }
                    return false;
                }


 function AjaxRequest(command) {
                     var ajaxManager = $find("<%= RadAjaxManager1.ClientID %>");
                    ajaxManager.ajaxRequest(command);
                }

.CS


 protected void RadAjaxManager1_AjaxRequest(object sender, AjaxRequestEventArgs e)
    {
       // base.RaisePostBackEvent(source, eventArgument);
        string eventArgument = e.Argument;
        if (eventArgument != null)
        {
             if (eventArgument.StartsWith("UpdateLedger|")) 
            {
                string[] strs = eventArgument.Split('|');
                if(strs.Length == 3)
                {
                    Guid? rateKey = Others.GetGuid(strs[1]);
                    int? ledger = Others.GetIntFromString(strs[2]);
                    if (rateKey.HasValue && ledger.HasValue)
                    {
                        bool updated = HMSModel.BLL.ReservationRateDB.UpdateReservationRateLedger(rateKey.Value, ledger.Value, ConnectionManager.CreateConnection(true));
                        if(updated)
                        {
                            this.LoadAllData(); // Reload all the data before rebind
                            BindLedgerList();
                        }
                    }
                }
            }
        }
    }
Maria Ilieva
Telerik team
 answered on 02 Jul 2014
4 answers
188 views
Hi,

I am trying to bind a simple RadListView using a WebService (ASMX).

Here is my code:
<telerik:RadListView runat="server" ID="lvTest">
    <ClientSettings>
        <DataBinding>
            <ItemTemplate>
                <div class="item">
                    #= Text#
                </div>
            </ItemTemplate>
            <EmptyDataTemplate>
                <div>No items</div>
            </EmptyDataTemplate>
            <DataService Location="~/Code/GenericHandlers/TestWS.asmx" DataPropertyName="Data" CountPropertyName="Count"
                DataPath="GetData" SortParameterType="Linq" FilterParameterType="Linq" />
        </DataBinding>
    </ClientSettings>
</telerik:RadListView>

Here is my TestWS.asmx (Json() simply convert the object to a Json string using the JavascriptSerializer):
<System.Web.Script.Services.ScriptService()> _
<System.Web.Services.WebService(Namespace:="http://tempuri.org/")> _
<System.Web.Services.WebServiceBinding(ConformsTo:=WsiProfiles.BasicProfile1_1)> _
<ToolboxItem(False)> _
Public Class TestWS
    Inherits System.Web.Services.WebService
 
    <WebMethod()> _
    Public Function GetData() As String
        Return Json(New With {Key .Data = New Temp() {New Temp("Item1"), New Temp("Item2")}, .Count = 2})
    End Function
 
End Class
 
Public Class Temp
    Private _text As String
 
    Public Property Text() As String
        Get
            Return _text
        End Get
        Set(ByVal value As String)
            _text = value
        End Set
    End Property
 
    Public Sub New(ByVal pText As String)
        _text = pText
    End Sub
End Class

When I run the page, I can see in the Chrome debugger that GetData is correctly called and return this: 
{"d":"{\"Data\":[{\"Text\":\"Item1\"},{\"Text\":\"Item2\"}],\"Count\":2}"}

But I can't understand why the ListView is still empty and don't show the data.

What did I miss there?

Jocelyn
Jocelyn
Top achievements
Rank 1
 answered on 02 Jul 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?