Telerik Forums
UI for ASP.NET AJAX Forum
1 answer
99 views

I am using RadFilter on a page connected to a RadGrid in the simplest way.  The RadGrid built in filter generates a correct filterexpression for use in dynamic linq.  However the RadFilter gets everything correct except for the fact that the field names are prefixed with "it."  

I also decompiled the RadFilter and related code and came across the following code in which it appears that the "it" prefix is very intentional and also very hard-coded.  This is forcing me to put in an event handler to search for the prepended 'it' and remove it.  What is happening here?

 

:

public string FormatFieldName(string fieldName, Type dataType, bool isCaseSensitive)
{
dataType = RadFilterTypeHelper.GetNonNullableType(dataType);
if (dataType == typeof (string))
{
string str = isCaseSensitive ? "" : ".ToUpper()";
return string.Format("iif(it.{0}==null,\"\",it.{0}).ToString(){1}", (object) fieldName, (object) str);
}
if (!(dataType == typeof (char)))
return string.Format("it.{0}", (object) fieldName);
string str1 = isCaseSensitive ? "" : ".ToUpper()";
return string.Format("Char(iif(it.{0}==null,'''',it.{0})).ToString(){1}", (object) fieldName, (object) str1);
}

Charles
Top achievements
Rank 1
 answered on 12 Aug 2015
20 answers
1.1K+ views
Hello!!

I need to allow exporting all the rows of my RadGrid to .CSV, however after i tested the exportToCSV button, it only exports the results of the first page(showed on the webpage).

It's possible to export all the GRID data ?? Can you tell me how?

Another thing I need to know, is how can i export only one column values to a pdf or excell..instead of all the collumns unformatted??
Jayesh Goyani
Top achievements
Rank 2
 answered on 12 Aug 2015
1 answer
180 views

Hey Guys,

So I setup a basic RadGrid (see below) with a few columns only to discover that both the GridEditCommandColumn, PerformInsertButton and CancelButton don't do anything when clicked. Any ideas?

 ASPX

<telerik:RadGrid ID="rgIssuers" runat="server" AutoGenerateColumns="False">
    <MasterTableView DataKeyNames="ID" EditMode="InPlace" CommandItemDisplay="Top">
        <CommandItemSettings
            ShowAddNewRecordButton="true"
            ShowRefreshButton="true"                        
            ShowExportToExcelButton="false"
            ShowExportToWordButton="false"
            ShowExportToPDFButton="false"
            ShowExportToCSVButton="false"
            AddNewRecordText="Add New Issuer" />
        <Columns>
 
            <telerik:GridEditCommandColumn ButtonType="ImageButton" UniqueName="EditColumn" >
                <ItemStyle HorizontalAlign="Center" />
                <HeaderStyle Width="35px" />
            </telerik:GridEditCommandColumn>
                     
            <telerik:GridButtonColumn ButtonType="ImageButton" CommandName="Delete" Text="Delete"
                UniqueName="DeleteColumn" ConfirmText="Delete this Issuer?" ConfirmDialogType="RadWindow"
                ConfirmTitle="Delete" >
                <ItemStyle HorizontalAlign="Center" />
                <HeaderStyle Width="35px" />
            </telerik:GridButtonColumn>
 
            <telerik:GridBoundColumn DataField="Name" UniqueName="Name" DataType="System.String" HeaderText="Name"></telerik:GridBoundColumn>
            <telerik:GridBoundColumn DataField="AccessCode" UniqueName="AccessCode" DataType="System.String" HeaderText="Access Code"></telerik:GridBoundColumn>
            <telerik:GridTemplateColumn DataField="SupportedAssertions" UniqueName="SupportedAssertions" DataType="System.Int32" HeaderText="Supported Assertions">
                <ItemTemplate>
                    <asp:Label id="lblSupportedAssertions" runat="server"></asp:Label>
                </ItemTemplate>
                <EditItemTemplate>
                    <telerik:RadListBox ID="lbSupportedAssertions" runat="server" SelectionMode="Multiple"></telerik:RadListBox>
                </EditItemTemplate>
            </telerik:GridTemplateColumn>
            <telerik:GridTemplateColumn HeaderText="Target">
                <ItemTemplate>
                    <asp:Label id="lblTarget" runat="server"></asp:Label>
                </ItemTemplate>
                <EditItemTemplate>
 
                </EditItemTemplate>
            </telerik:GridTemplateColumn>
        </Columns>
    </MasterTableView>
</telerik:RadGrid>

ASPX.VB

Protected Sub rgIssuers_NeedDataSource(sender As Object, e As GridNeedDataSourceEventArgs) Handles rgIssuers.NeedDataSource
 
    'get our issuers
    rgIssuers.DataSource = Issuer.FindByCLC(_csAC, _strCLC)
 
End Sub

infoweshanney
Top achievements
Rank 2
 answered on 12 Aug 2015
5 answers
257 views

With version 2012.2.607.35 of the Telerik.Web.UI.dll

<td>
    <telerik:RadListBox runat="server" ID="RadListBoxF" Height="230px" Width="98%" ButtonSettings-AreaWidth="35px" CheckBoxes="true" EmptyMessage="No Key Sets Added">
    </telerik:RadListBox>
</td>

 

The ListBox was fixed at the height, and any extra height needed was got to by a scroll bar. Empty message appears in the center of the box.

With version 2014.3.1024.35 of the dll.

The list box is the height of the items, and keeps growing. the empty message is at the top (but this is the only item in the box).

This is on IE9.

Ivan Danchev
Telerik team
 answered on 12 Aug 2015
1 answer
92 views

Hello,

I have a RadTreeList cotrol. Within this is a TreeListTemplateColumn.
Inside this I have two DIVs and radbutton configured as a custom toggle.  What I’d like to do is is when the user clicks the toggle button the system hides one div and shows the other.

I’ve had a go at this with little success.  Here is the code for the buttons

 

<telerik:RadButton ID="RadButton2" runat="server" ButtonType="LinkButton" Checked="True"
        Skin="Metro" ToggleType="CustomToggle" OnClientToggleStateChanged="SetVisibility"
        AutoPostBack="False">
        <ToggleStates>
            <telerik:RadButtonToggleState PrimaryIconCssClass="rbToggleCheckboxChecked" Text="Existing" />
            <telerik:RadButtonToggleState PrimaryIconCssClass="rbToggleCheckbox" Text="New" />
        </ToggleStates>
    </telerik:RadButton>

 

And here is the associated JavaScript:

            function SetVisibility(sender, args)
    {
        switch (args.get_currentToggleState().get_text())
        {
            case "Existing":
                showstuff('existing');
                hidestuff('new');
                break;
            case "New":
                showstuff('new');
                hidestuff('existing');
                break;
            default:
                hidestuff('new');
                hidestuff('existing');
                break;
        }
    }
 
    function showstuff(boxid){
   document.getElementById(boxid).style.visibility="visible";
}
  
function hidestuff(boxid){
   document.getElementById(boxid).style.visibility="hidden";
}

 

The problem with this is that is doesn't matter which button (row) within the treelist you click, the only DIVs that get changed are those within the first row.
Any ideas how I can overcome this?

Eyup
Telerik team
 answered on 12 Aug 2015
2 answers
194 views
We have a scenario, with a batch-mode grid page, that is inserted into multiple pages (via an IFrame) on the site.  Depending upon the containing page, the grid will show different (but related) columns.  In most cases, we have the grid freeze the first three columns ​which works fine.  However, in a two cases, the frozen columns are hidden and horizontal scrolling is not necessary.  As such, we would like to simply remove the FrozenColumnsCount (or possibly just set it to 0?).  How can I do this using both client-side and code-behind code?
Eyup
Telerik team
 answered on 12 Aug 2015
2 answers
56 views

Hi,

I'm using this example - http://docs.telerik.com/devtools/aspnet-ajax/controls/scheduler/how-to/replace-the-edit-form

when the AppointmentEditing event fires the apt object is blank?

function AppointmentEditing(sender, eventArgs) {
        var apt = eventArgs.get_appointment();
        var oWindow = window.radopen("CalenderAdvancedForm.aspx?Mode=Edit&AppointmentID=" + apt.ID, "AdvancedForm");
        oWindow.Maximize();
        oWindow.SetTitle("Edit Appointment");
        oWindow.Center();
        eventArgs.set_cancel(true);
    }

<telerik:RadScheduler ID="RadScheduler1" runat="server" DataDescriptionField="Description" DataEndField="End" DataKeyField="ID" DataRecurrenceField="RecurrenceRule" DataRecurrenceParentKeyField="RecurrenceParentID" DataReminderField="Reminder" DataSourceID="SqlDataSource1" DataStartField="Start" DataSubjectField="Subject" Height="700px" SelectedView="WeekView" Skin="Metro" TimeZoneID="Central Standard Time" Width="990px" WorkDayEndTime="18:00:00" CustomAttributeNames="Type" EnableCustomAttributeEditing="True" TimeZoneOffset="-06:00:00" StartInsertingInAdvancedForm="false"
     OnClientAppointmentEditing="AppointmentEditing" 
     OnClientAppointmentInserting="AppointmentInserting" >

Ivan Danchev
Telerik team
 answered on 12 Aug 2015
3 answers
265 views

When the ZIndex property arrived (2015 Q1 release?) it caused my chart to render incorrectly as shown in image "1_2015_Q1_&_Q2_Default_ZIndexes". My chart plots both before and after values of a set of history data (databound from the server side).

To fix the rendered output (to that prior to the 2015 Q1 release), I manually set the ZIndex of each series so that the datapoint and line of the same series are on top. This is shown in image "2_2015_Q1_ZIndexes_Set".

This was fine (not ideal but it worked) until 2015 Q2 arrived (and has not been corrected in 2015 Q2 SP1 either). Image "3_2015_Q2_Manual_ZIndexes" shows the issue when hovering on a series ​below another- the series datapoint below doesn't show through the series datapoint on top any longer. Leaving the ZIndexes to default fixes this, but makes the chart render like in image "1_2015_Q1_&_Q2_Default_ZIndexes". This is a minor issue.

However, things get worse, for charts with missing values. This chart's series have MissingValues = HtmlChart.MissingValuesBehavior.Gap and manual ZIndexes set. If there are gaps in the plotted data, I receive a JavaScript error every time the chart is refreshed as shown in image "4_2015_Q2_ZIndexesSet_JS_Error". If I close the error popup and click a series in the legend, the chart renders until it is refreshed again. The JavaScript error does not appear if the plotted data is complete though.

Therefore can you please assist me to either of the following workarounds until the two bug fixes can be applied:

1. Go back to allowing default ZIndexes, but fix the chart rendering to be like in image "2_2015_Q1_ZIndexes_Set", where ZIndexes are set.

2. Avoid the JavaScript error for manually set ZIndexes and MissingValues = HtmlChart.MissingValuesBehavior.Gap somehow.

Thanks

Thanks

Danail Vasilev
Telerik team
 answered on 12 Aug 2015
1 answer
125 views

So, after google-ing for about 6 hours or so I finally gave up. Hope someone here can hook me up with advice.

I'm creating a dynamic function for all grids in my DNN module. ​When I double click on a row, I call the function editKey, which takes in parameter grid and fetches its ID (For now I only have two grids, but that is not the issue). ​Then it fetches all the information about that row​ and a new RadWindow opens up where the prefetched information can be seen and/or managed/deleted.
As I open a new window, I load a new <div> inside it which serves as a template for each grid. The strange thing is, when I add the div to the server (runat="server) I cant seem to find it with the $find('<% ​CodaEdit1  %>') call.

 I want to use all of my prefetched info and put it into this div. My first thought of accessing the divs elements was to use something like

document.getElementById("CodaEdit1").children[i].setAttribute("Text", info[i]);

But that does not do anything.
Neither can I access the first element in the div with

document.getElementById("FindMe");​

but

var re = $find('<%= FindMe.ClientID %>');
        re.set_value("this works");

Works perfectly. I can of course write the find function for each and every radtextbox that I have, but my code will look pretty ugly and scale terrible as my project grows.​

Here is the referenced code

 

<div id="CodaEdit1" style="display:none">
        <telerik:RadTextBox ID="FindMe" runat="server" Label="Rule" Text=""></telerik:RadTextBox>
         
</div>
 
<script type="text/javascript">
     
    var keySelected;
 
    function editKey(sender)
    {
        var whichLayout = windowLayout(sender);
        var grid, divinsert;
 
        switch(whichLayout)
        {
            case ("1"):
                grid = $find('<%= RadGrid1.ClientID %>');
                break;
            case ("2"):
                grid = $find('<%= RadGrid2.ClientID %>');
                break;
        }
        divinsert = $get("CodaEdit"+whichLayout);
 
        var masterTableView = grid.get_masterTableView();
        keySelected = rowInfo(masterTableView);
 
        //alert(document.getElementById("CodaEdit1").children[0]); <-- HTMLELEMENTSPAN
        document.getElementById("CodaEdit1").children[0].setAttribute("Text", "Goon"); <-- Does nothing
 
        var editWindow = GetRadWindowManager().open(null, null, divinsert, 1200, 200);//; 10, 10);
        editWindow.center();
 
//alert(document.getElementById("CodaEdit1").children[0].textContent); <-- finds the text content
 
 
        var re = $find('<%= FindMe.ClientID %>');
        re.set_value("#gfdgdfgsd");
         
 
    }
 
    function windowLayout(gridSender)
    {
        var layoutType = gridSender.get_id();
        return layoutType.charAt(layoutType.length - 1);
         
    }
 
    function rowInfo(aTableView)
    {
        var selectedItems = aTableView.get_selectedItems();
        var row = selectedItems[0];
         
        var columns = aTableView.get_columns();
        var resultArray = [];
        for (var i = 0; i < columns.length; i++)
        {
            var category = columns[i].get_uniqueName();
            var cellValue = $(row.get_cell(category)).text();
 
            resultArray.push(cellValue);
        }
        return resultArray;
    }
</script>

 

<telerik:RadGrid ID="RadGrid1"
        runat="server"
        AllowPaging="True"
        AllowSorting="True"
        DataSourceID="​blablablawooo"
        GroupPanelPosition="Top"
        ShowGroupPanel="True"
        EnableLinqExpressions="False"
        AllowFilteringByColumn="True"
        OnInit="RadGrid1_Init"
        OnItemCommand="RadGrid1_ItemCommand"
        OnPreRender="RadGrid1_PreRender"
        Height="600px">
        <ClientSettings AllowDragToGroup="True" AllowColumnsReorder="True" EnableRowHoverStyle="True">
            <Selecting AllowRowSelect="True" />
            <Scrolling AllowScroll="True" EnableVirtualScrollPaging="True" />
            <Resizing AllowColumnResize="True" />
            <ClientEvents OnFilterMenuShowing="filterMenuShowing" OnRowDblClick="editKey"/>
        </ClientSettings>

        <MasterTableView AutoGenerateColumns="False" DataKeyNames="RULE_ID" DataSourceID="its a secret yo">
            <Columns>
                <telerik:GridBoundColumn AllowFiltering="False" DataField="RULE_ID" DataType="System.Decimal" FilterControlAltText="Filter RULE_ID column" HeaderText="RULE ID" ReadOnly="True" SortExpression="RULE_ID" UniqueName="RULE_ID">
                </telerik:GridBoundColumn>

etcetc...​

IT-Fjárvakur
Top achievements
Rank 1
 answered on 12 Aug 2015
1 answer
584 views

We have just started using UI for ASP.NET AJAX. Everything works fine until we try using client-side code. We keep receiving this error : "JavaScript runtime error : '$telerik' is undefined". I've searched for a solution online but none of the suggested solutions works.

 

At the moment our web.config has the following entries which according to online sources would solve the problem but didn't :

 <location path="Telerik.Web.UI.WebResource.axd">
  <system.web>
    <authorization>
      <allow users="*"/>
    </authorization>
  </system.web>
</location>

<system.web>
  <httpHandlers>
    <add path="Telerik.Web.UI.WebResource.axd" type="Telerik.Web.UI.WebResource" verb="*" validate="false" />        
  </httpHandlers>
</system.web>

<system.webServer>
  <handlers>
    <add name="Telerik.Web.UI.WebResource"  path="Telerik.Web.UI.WebResource.axd" verb="*" type="Telerik.Web.UI.WebResource, Telerik.Web.UI, Version=2014.2.724.35, Culture=neutral, PublicKeyToken=121fae78165ba3d4" />
  </handlers>
</system.webServer>

 We also tried the following to no avail :

<system.webServer>
  <handlers>
    <add name="Telerik_Web_UI_WebResource_axd" verb="*" path="Telerik.Web.UI.WebResource.axd" type="Telerik.Web.UI.WebResource" preCondition="integratedMode" />
  </handlers>
</system.webServer>

In default.aspx we have the following :

 

        <telerik:RadScriptManager ID="scriptManagerMain" 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" />
            </Scripts>
            <Services>
                <asp:ServiceReference Path="~/WCF/DataService.svc"/>
            </Services>            
        </telerik:RadScriptManager>
        <telerik:RadAjaxManager ID="radAjaxManagerMain" runat="server">
        </telerik:RadAjaxManager>

With all these settings we still keep receiving the "JavaScript runtime error : '$telerik' is undefined" error.​ I really hope someone knows the solution to this problem because we're stick here and can't find a solution. Thanks in advance for any help.

 

Viktor Tachev
Telerik team
 answered on 12 Aug 2015
Narrow your results
Selected tags
Tags
+? more
Top users last month
Ambisoft
Top achievements
Rank 2
Iron
Pascal
Top achievements
Rank 2
Iron
Matthew
Top achievements
Rank 1
Sergii
Top achievements
Rank 1
Iron
Iron
Andrey
Top achievements
Rank 1
Iron
Want to show your ninja superpower to fellow developers?
Top users last month
Ambisoft
Top achievements
Rank 2
Iron
Pascal
Top achievements
Rank 2
Iron
Matthew
Top achievements
Rank 1
Sergii
Top achievements
Rank 1
Iron
Iron
Andrey
Top achievements
Rank 1
Iron
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?