Telerik Forums
UI for ASP.NET AJAX Forum
2 answers
55 views

To whoever cares:

Why don't  you just get rid of the Telerik name and quit moving incrementally in that direction. The need to stamp Progress on everything is now literally moving useful information out of sight.

 

 

John S.
Top achievements
Rank 1
 answered on 18 May 2017
4 answers
144 views

Unable to get property 'trackChanges' of undefined or null reference in IE 9 and above and chrome.   No issues in IE 8.  Using jQuery on page load. 

var resultsDropDowlist = Terlerk.web.UI.RadComboBox.ComboBoxes[2];

resultsDropDownlist.trackChanges();

//To Clear the Selected Item

resultsDropDownList.get_items().clear();

thomas
Top achievements
Rank 1
 answered on 17 May 2017
0 answers
173 views

Hello!

I try to create dynamic url like https://mylink.com/?parameter1={0}&parameter2={1}, but I can get only single parameter  from field DataNavigateUrlFields="myfield".

Any ideas?

After that, I tried to resolve my issue dynamically with code:

protected void OrdersRadGrid_ItemDataBound(object sender, GridItemEventArgs e)
        {
            if (e.Item is GridDataItem)
            {
                GridDataItem item = (GridDataItem)e.Item;

                TableCell tb = item["item1"];
                HyperLink lnk = new HyperLink();
                lnk.ID = "routeId";
                lnk.Text = item["item1"].Text;
                string str1 = item["item2"].Text;
                string str2 = item["item3"].Text;
                lnk.NavigateUrl = string.Format("https://mylink.com/?parameter={0}{1}", str1, str2);
                tb.Controls.Clear();
                tb.Controls.Add(lnk);

}

}

But, I get an interesting bug: in construction item["item"].Text not all fields displays correct. In debugger, i can see in the item all the fields with their correct values. But some of them (right these I need to use!), give me '&nbsp' value. Thus, expression siring str=item["item1"].Text returns me value '&nbsp' (not in all text type fields, but only in several in the same item). May it be encoding problem? Or any other ideas?

               

 

 

Олег
Top achievements
Rank 1
 asked on 17 May 2017
7 answers
251 views
I am getting the following error message sometimes when my scheduler is trying to display.  I am feeding it a dataset with start and end dates that traverse anywhere from one day to many weeks.  All of the data looks good and no end dates are less than the start dates.  Are there any quick things I could check to fix this.

I have implemented a custom appointment comparing class and when I use this the scheduler does initially display all values, but once I click to access anything else I get the error below.

Please help when you can.

Error:
Unable to sort because the IComparer.Compare() method returns inconsistent results. Either a value does not compare equal to itself, or one value repeatedly compared to another value yields different results. IComparer: 'Telerik.Web.UI.AppointmentComparer'.

Type:
System.ArgumentException

Stack Trace:
at System.Collections.Generic.IntrospectiveSortUtilities.ThrowOrIgnoreBadComparer(Object comparer)
at System.Collections.Generic.ArraySortHelper`1.Sort(T[] keys, Int32 index, Int32 length, IComparer`1 comparer)
at System.Collections.Generic.List`1.Sort(Int32 index, Int32 count, IComparer`1 comparer)
at Telerik.Web.UI.Scheduler.Views.Month.Model.CreateDaySlot(DateTime dayStart, DateTime dayEnd, Int32 dayIndex, DateTime weekStart, IList`1 trimmedAppointments)
at Telerik.Web.UI.Scheduler.Views.Month.Model.DataBind(AppointmentCollection appointments)
at Telerik.Web.UI.RadScheduler.CreateContent()
at Telerik.Web.UI.RadScheduler.CreateChildControls(Boolean bindFromDataSource)
at System.Web.UI.Control.EnsureChildControls()
at System.Web.UI.Control.FindControl(String id, Int32 pathOffset)
at System.Web.UI.Page.ProcessPostData(NameValueCollection postData, Boolean fBeforeLoad)
at System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint)
Trevor
Top achievements
Rank 1
 answered on 17 May 2017
0 answers
250 views

I have a ComboBox that I would like to change the Text value on the client side using JavaScript.  How can I go about setting the text of a CB by passing a custom parameter.  I would like this to be a universal function so I need to find the object calling the function, set the Substring value based on a passed parameter, and then set the text property of the CB to that.  For example, options are:  

1 | Item 1

2 | Item 2

3 | Item 3

On the event OnClientSelectedIndexChanged I would like to change the text to only the left character.  What I am looking for is something like this, but works:

<telerik:RadComboBox ID="rcbItemCode" runat="server" CssClass="block width2" RenderMode="Lightweight" ExpandDirection="Down" DropDownAutoWidth="Enabled" EnableLoadOnDemand="True"
                                                    ShowMoreResultsBox="true" EnableVirtualScrolling="true" OnItemsRequested="rcb_ItemsRequested" OnClientFocus="SetTextOfTheComboBox" OnClientSelectedIndexChanged="function (radcombobox, args) {special(this, args, 1);}" />
 
<script type="text/javascript">
    function special(sender, eventArgs, len) {
        debugger;
        var item = eventArgs.get_item();
        var clientId = item.get_id();
        var rcb = document.getElementById(clientId);;
        var newText = rcb.get_text().substring(0, len);
        rcb.set_text(newText);
    }
</script>
Dennis
Top achievements
Rank 1
 asked on 17 May 2017
1 answer
197 views

Hello, 

I am currently using the checkbox template column to bind a boolean column which seems to be working fine except for one major problem. 

When I click the checkbox (changed state) I will have to click multiple times around and/or above the checkbox row location to trigger the edited flag.

I need the flag triggered in order to call my batch edit save button function. (Batch save wont trigger without having edit flag up)

Everything seems to be binding properly without issue but except for getting the flag to trigger. Again, only multiple clicks around the checkbox will finally trigger the flag (exact position isn't clear). 

 

Best, 

-R

 

ASP Code:

 

<telerik:GridTemplateColumn ColumnEditorID="CompletedBox" Reorderable="true" AllowSorting="true" HeaderText="Complete" >
                  <HeaderStyle Width="60px" />
                  <ItemStyle CssClass="float-right" />
                   <ItemTemplate> 
                    <asp:CheckBox ID="CheckBox3" runat="server" Checked='<%# Bind("CompletedAsBool") %>' /> 
                   </ItemTemplate>
                  <EditItemTemplate >
                    <asp:CheckBox ID="CheckBox2" runat="server" Checked='<%# Bind("CompletedAsBool") %>' />
                  </EditItemTemplate>
</telerik:GridTemplateColumn>

Vessy
Telerik team
 answered on 17 May 2017
4 answers
510 views
Hi,
On client side  button click event, I want to get control id that are place in Item template of List-view
swarupa
Top achievements
Rank 1
 answered on 17 May 2017
1 answer
139 views
Hi 
I have a RadTabStrip with 3 tabs which has a User Control on each tab. Each User Control has a Radgrid on it, I am trying to add filtering to some of the columns. The filters are showing but has no response when entering anything in them, they just don't do anything at all..
Please advise me on this, here is my markup:

<%@ Control Language="C#" AutoEventWireup="true" CodeFile="RadGridsUserControlCS.ascx.cs" Inherits="RadGridsUserControlCS1" %>
<%@ Register TagPrefix="telerik" Namespace="Telerik.Web.UI" Assembly="Telerik.Web.UI" %>

<div>

    <asp:Label ID="lblEmpID" runat="server"></asp:Label>

    <br />
    <br />

    <asp:Label ID="Label1" runat="server" Text="Project:"></asp:Label>

    <asp:DropDownList ID="DropDownList1" runat="server" DataSourceID="SqlDataSource4" DataTextField="projno" DataValueField="dbcsuffix">
    </asp:DropDownList>

    <asp:SqlDataSource ID="SqlDataSource4" runat="server" ConnectionString="<%$ ConnectionStrings:DMCONFIGConnectionString %>" SelectCommand="SELECT projno, dbcsuffix FROM fProject"></asp:SqlDataSource>

    <br />

    <telerik:RadAjaxManagerProxy ID="RadAjaxManagerProxy1" runat="server">
        <AjaxSettings>
            <telerik:AjaxSetting AjaxControlID="gridFilesDisplay" >
                <UpdatedControls>
                    <telerik:AjaxUpdatedControl ControlID="gridFilesDisplay" LoadingPanelID="RadAjaxLoadingPanel1" />                
                </UpdatedControls>          
            </telerik:AjaxSetting>      
        </AjaxSettings>
    </telerik:RadAjaxManagerProxy>

    <telerik:RadAjaxLoadingPanel ID="RadAjaxLoadingPanel1" runat="server" Skin="Vista" ></telerik:RadAjaxLoadingPanel>

    <telerik:RadCodeBlock ID="RadCodeBlock1" runat="server">

        <script type="text/javascript">

            function onRequestStart(sender, args)
            {
                if (args.get_eventTarget().indexOf("ExportToExcelButton") >= 0 || args.get_eventTarget().indexOf("ExportToPdfButton") >= 0)
                {
                    args.set_enableAjax(false);
                }
            }

        </script>    

         <script type="text/javascript">

             function openDocumentComments(position, Documentno)
             {
                 var oWnd = radopen("DocumentComments.aspx?position=" + position, + "&Documentno=" + Documentno, "DocumentComments");
                 oWnd.center();
             }

             function RefreshPageForGrid()
             {
                 window.location.href = "RadGridsUserControlCS.aspx";
             }

         </script> 

        <script  type="text/javascript">

                    Sys.Application.add_load(AppLoad);

                    function AppLoad() {
                        Sys.WebForms.PageRequestManager.getInstance().add_endRequest(EndRequest);
                        Sys.WebForms.PageRequestManager.getInstance().add_beginRequest(BeginRequest);
                    }

                    function BeginRequest(sender, args) {
                        // Clear the error if it's visible from a previous request.
                        if ($get('Error').style.visibility == "visible")
                            CloseError();
                    }

                    function EndRequest(sender, args) {
                        // Check to see if there's an error on this request.
                        if (args.get_error() != undefined) {
                            // If there is, show the custom error.
                            $get('Error').style.visibility = "visible";

                            // Let the framework know that the error is handled, 
                            //  so it doesn't throw the JavaScript alert.
                            args.set_errorHandled(true);
                        }
                    }

                    function CloseError() {
                        // Hide the error div.
                        $get('Error').style.visibility = "hidden";
                    }
        </script>

    </telerik:RadCodeBlock>

    <telerik:RadWindowManager ID="RadWindowManager1" runat="server" Skin="Vista">

        <Windows>

            <telerik:RadWindow Skin="Vista" ID="DocumentComments" runat="server" Title="Document Comments"
                Height="400px" Width="300px" Left="150px" ReloadOnShow="true" Modal="true" 
                OpenerElementID="btnProjReject" NavigateUrl="~/DocumentComments.aspx"/>

        </Windows>

    </telerik:RadWindowManager>

    <br />

</div>

<div>
    <asp:UpdatePanel ID="UpdatePanel1" runat="server">
        <ContentTemplate>
            

            <telerik:RadGrid ID="gridFilesDisplay" 
                Skin="WebBlue" 
                runat="server" 
                AutoGenerateColumns="False" 
                OnNeedDataSource="gridFilesDisplay_NeedDataSource" 
                OnItemCommand="gridFilesDisplay_ItemCommand" 
                OnPreRender="gridFilesDisplay_PreRender" 
                OnLoad="gridFilesDisplay_Load"
                OnItemDataBound="gridFilesDisplay_ItemDataBound" 
                AllowFilteringByColumn="True">

                    <ClientSettings EnablePostBackOnRowClick="true">
                        <Selecting AllowRowSelect="True" />
                    </ClientSettings>

                    <MasterTableView DataKeyNames="position" CommandItemDisplay="Top">

                        <DetailTables>

                            <telerik:GridTableView DataKeyNames="position,category" DataSourceID="SqlDataSource2" Width="100%" runat="server" Name="Categories">

                                <DetailTables>
                                    <telerik:GridTableView runat="server" DataKeyNames="position,category" DataSourceID="SqlDataSource3" Name="Documents" Width="100%">

                                        <ParentTableRelation>
                                            <telerik:GridRelationFields DetailKeyField="category" MasterKeyField="category" />
                                        </ParentTableRelation>

                                        <Columns>

                                            <telerik:GridTemplateColumn DataType="System.Char"  UniqueName="DocumentComments" DataField="DocumentComments" AllowFiltering="false" FilterControlAltText="test"><%--HeaderText="Appr/Reject"--%>

                                               <ItemTemplate>

                                                   <a href="#"  style="text-decoration:none; color: red" onclick="openDocumentComments('<%# DataBinder.Eval(Container.DataItem, "position") %>, <%# DataBinder.Eval(Container.DataItem, "Documentno") %>'); return false;">Reviewed</a> 
                                               
                                               </ItemTemplate>
                           
                                                <EditItemTemplate>

                                                    <%--<asp:Button runat="server" ID="btnDocApprove" Text="Approve" Width="60px" OnClick="btnDocApprove_Click" />--%>

                                                    <%--<a href="#" onclick="openDocRadWindow('<%# DataBinder.Eval(Container.DataItem, "WBSEmpDocId") %>', '<%# DataBinder.Eval(Container.DataItem, "LineNbr") %>'); return false;" style="color: red">Reject</a>--%>

                                                </EditItemTemplate>

                                                <HeaderStyle Width="12%" Font-Bold="True" />
                                                <ItemStyle Font-Bold="true" HorizontalAlign="Center"/>

                                            </telerik:GridTemplateColumn>


                                            <telerik:GridBoundColumn DataField="position" HeaderText="Position" UniqueName="position" Visible="false" AllowFiltering="false">
                                                
                                            </telerik:GridBoundColumn>

                                            <telerik:GridBoundColumn DataField="category" HeaderText="Category" UniqueName="category" Visible="false" AllowFiltering="false">
                                                
                                                <HeaderStyle Font-Bold="true" />
                                            </telerik:GridBoundColumn>

                                            <telerik:GridBoundColumn DataField="Documentno" HeaderText="Document No" UniqueName="Documentno" AllowFiltering="true">
                                                
                                                <HeaderStyle Font-Bold="true" Width="10%" />
                                            </telerik:GridBoundColumn>

                                            <telerik:GridBoundColumn DataField="Rev_Now" HeaderText="Rev Now" UniqueName="Rev_Now" AllowFiltering="false">
                                                
                                                <HeaderStyle Font-Bold="true" Width="10%" />
                                            </telerik:GridBoundColumn>

                                            <telerik:GridBoundColumn DataField="STS_Now" HeaderText="STS Now" UniqueName="STS_Now" AllowFiltering="false">
                                                
                                                <HeaderStyle Font-Bold="true" Width="10%" />
                                            </telerik:GridBoundColumn>

                                            <telerik:GridBoundColumn DataField="MDR_Title" HeaderText="MDR Title" UniqueName="MDR_Title" AllowFiltering="true" FilterControlWidth="100px" >
                                                
                                                <HeaderStyle Font-Bold="true" Width="35%" />
                                            </telerik:GridBoundColumn>

                                            <telerik:GridBoundColumn DataField="storename" HeaderText="storename" UniqueName="storename" Visible="false" AllowFiltering="false">
                                                
                                                <HeaderStyle Font-Bold="true" />
                                            </telerik:GridBoundColumn>

                                            <telerik:GridTemplateColumn HeaderText="Download Document" AllowFiltering="false">

                                                <ItemTemplate>
                                                    <asp:LinkButton ID="LinkButton1" runat="server" CommandArgument='<%# Eval("storename") %>' CommandName="DownloadMyFile" Text="Download"></asp:LinkButton>
                                                    <%--<telerik:RadButton RenderMode="Lightweight" ID="DownloadMyFile" OnClientClicked="DownloadMyFile" CommandName="DownloadMyFile" Text="Download" AutoPostBack="false" runat="server" Width="90px">
                                                    </telerik:RadButton>--%>
                                                    <%--Text='<%# Eval("storename") %>'--%>
                                                </ItemTemplate>

                                                <HeaderStyle Font-Bold="true" />
                                            </telerik:GridTemplateColumn>

                                        </Columns>

                                    </telerik:GridTableView>
                                </DetailTables>

                                <ParentTableRelation>

                                    <telerik:GridRelationFields DetailKeyField="position" MasterKeyField="position"></telerik:GridRelationFields>

                                </ParentTableRelation>

                                <Columns>

                                    <telerik:GridBoundColumn HeaderText="Position" DataField="position" UniqueName="position" Visible="false" AllowFiltering="false">
                                        
                                    </telerik:GridBoundColumn>

                                    <telerik:GridBoundColumn HeaderText="Category" DataField="category" UniqueName="category" AllowFiltering="false">
     
                                        <HeaderStyle Width="10%" Font-Bold="true" />

                                    </telerik:GridBoundColumn>

                                    <telerik:GridBoundColumn HeaderText="Category Description" DataField="categorydesc" UniqueName="categorydesc" AllowFiltering="false">

                                        <HeaderStyle Width="90%" Font-Bold="true" />

                                    </telerik:GridBoundColumn>

                                </Columns>

                            </telerik:GridTableView>

                        </DetailTables>

                        <Columns>

                            <telerik:GridBoundColumn HeaderText="Position" DataField="position" UniqueName="position" Visible="false" AllowFiltering="false">
                                
                            </telerik:GridBoundColumn>

                            <telerik:GridBoundColumn HeaderText="First Name" DataField="firstname" UniqueName="firstname" AllowFiltering="false">

                                <HeaderStyle Width="20%" Font-Bold="true" />

                            </telerik:GridBoundColumn>

                            <telerik:GridBoundColumn HeaderText="Last Name" DataField="lastname" UniqueName="lastname" AllowFiltering="false">

                                <HeaderStyle Width="80%" Font-Bold="true" />

                            </telerik:GridBoundColumn>

                        </Columns>
                    </MasterTableView>

            </telerik:RadGrid>

            <asp:Button ID="btnApprove" runat="server" Text="Approve" Visible="false" OnClick="btnApprove_Click" />

        </ContentTemplate>
    </asp:UpdatePanel>
</div>

<asp:SqlDataSource ID="SqlDataSource1" runat="server" ConnectionString="<%$ ConnectionStrings:DocViewConnectionString %>"
    DeleteCommand=""
    InsertCommand=""
    SelectCommand="xLevel1Names" SelectCommandType="StoredProcedure"
    UpdateCommand="" UpdateCommandType="Text" >
       
    <SelectParameters>

        <asp:SessionParameter Name="User" SessionField="User" Type="String" />
      <%--  <asp:SessionParameter Name="User" SessionField="User" Type="String" />--%>

    </SelectParameters>

</asp:SqlDataSource>

<asp:SqlDataSource ID="SqlDataSource2" runat="server" ConnectionString="<%$ ConnectionStrings:DocViewConnectionString %>"
    DeleteCommand=""
    InsertCommand=""
    SelectCommand="xLevel2Categories" SelectCommandType="StoredProcedure"
    UpdateCommand="" UpdateCommandType="Text" >
       
    <SelectParameters>

        <asp:SessionParameter Name="User" SessionField="User" Type="String" />

    </SelectParameters>

</asp:SqlDataSource>

<asp:SqlDataSource ID="SqlDataSource3" runat="server" ConnectionString="<%$ ConnectionStrings:DocViewConnectionString %>"
    DeleteCommand=""
    InsertCommand=""
    SelectCommand="xLevel3Docs" SelectCommandType="StoredProcedure"
    UpdateCommand="" UpdateCommandType="Text" >
       
    <SelectParameters>

        <asp:SessionParameter Name="User" SessionField="User" Type="String" />

        <asp:Parameter Name="category" Type="String" />

    </SelectParameters>

</asp:SqlDataSource>

<br />

<asp:Label ID="lblMessage" runat="server"></asp:Label>
Marin Bratanov
Telerik team
 answered on 17 May 2017
4 answers
129 views

Hello,

 

I just came across an issue trying to enable/disable the Treeview control

It is declared this way : 

<telerik:RadTreeView RenderMode="Classic" runat="Server" ID="trProvince" Height="350" CheckBoxes="True" TriStateCheckBoxes="true"  CheckChildNodes="true" OnClientNodeClicked="ClientNodeClicked" Enabled="False" CssClass="Province"  >

 

Next of it, there's a checkbox that allows to enable/disable it

 

Here's the JS doing that : 

function ToggleRow(sender, eventArgs) {
    var rowClass = "." + sender.get_id().substring(3);
    var isChecked = sender.get_checked();
 
    console.log(rowClass);
    console.log(isChecked);
 
    $(rowClass).each(function() {
        $(this).each(function () {
            var element = $find($(this)[0].id);
 
            console.log(element);
            console.log("enabled :" + element.get_enabled());
 
            if (isChecked) {
                element.enable && element.enable();
                element.set_enabled && element.set_enabled(true);
            } else {
                element.disable && element.disable();
                element.set_enabled && element.set_enabled(false);
            }
                                 
        });
    });
}

 

It's working as in : When checkbox is checked, I can click the checkboxes in the TreeView, expand/collapse its node but it still has a "disabled" style (greyed)

How do I get it to remove the grey layer on the control?

Thank you 

Telerik version : 2017.1.118

Peter Milchev
Telerik team
 answered on 17 May 2017
1 answer
254 views

Within a step of my radwizard I need a button that is supposed to dynamically add some fields to my form as needed. No matter what I do, the button click event won't fire. What am I missing? I've added a simple demo to demonstrate:

<telerik:RadWizard RenderMode="Lightweight" ID="RadWizardIncidentGroupA" runat="server" CssClass="formfont" Width="100%" OnClientLoad="OnClientLoad" Skin="Bootstrap"
OnClientButtonClicking="OnClientButtonClicking"
OnFinishButtonClick="RadWizardIncidentGroupA_FinishButtonClick" 
 OnCancelButtonClick="RadWizardIncidentGroupA_CancelButtonClick"
BorderColor="#cccccc">
<WizardSteps>
     <telerik:RadWizardStep ID="RadWizardStep1" Title="Administrative" StepType="Start" DisplayCancelButton="true" 
                 runat="server">
                    <div class="inputWrapper">
                         <asp:Label ID="lblTest" Text="Test1" runat="server"></asp:Label>
                         <asp:Button ID="ChangeText" runat="server" Text="Add an Offense" OnClick="ChangeText_Click" />
                    </div>
               </telerik:RadWizardStep>

         </WizardSteps>

</telerik:RadWizard>

 

CODEBEHIND:

protected void ChangeText_Click(object sender, EventArgs e)
{
            lblTest.Text = "Test2";
}

chee
Top achievements
Rank 1
 answered on 17 May 2017
Narrow your results
Selected tags
Tags
+? more
Top users last month
Rob
Top achievements
Rank 3
Iron
Iron
Iron
Atul
Top achievements
Rank 1
Iron
Iron
Iron
Alexander
Top achievements
Rank 1
Veteran
Iron
Serkan
Top achievements
Rank 1
Iron
Shawn
Top achievements
Rank 1
Iron
Iron
Want to show your ninja superpower to fellow developers?
Top users last month
Rob
Top achievements
Rank 3
Iron
Iron
Iron
Atul
Top achievements
Rank 1
Iron
Iron
Iron
Alexander
Top achievements
Rank 1
Veteran
Iron
Serkan
Top achievements
Rank 1
Iron
Shawn
Top achievements
Rank 1
Iron
Iron
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?