Telerik Forums
UI for ASP.NET AJAX Forum
2 answers
209 views
I am using an asmx webservice to serve up JSON mapping data to the RadCLientDataSource, then binding in MapLayer, yet I am having no success in getting the control to plot the markers.  I have tested the basics like is it serving up a staic JSON (using the demo JSON files) and this works. (So not an issue with the web.config file).  I have also confirmed using Fiddler that the JSON file is being served up correctly (it is correctly parsed in the JSON tab of fiddler, and I have no d schema requirements). So as far as I can see have a clean structured, zero error, JSON file being sent to the browser.

I have then set the LocationField='Location' in the maplayer where Location is the JSON filed and this is an array of Latitude/Longitude values.  Therefore I am stumped, as there are no examples of serving the mapping file via a webservice I wondering if it simply does not work.  Any thoughts please, or any suggestions how I can debug why the data is not being mapped ?

As stated it works fine with a static file - but when using asmx file I cannot get it to work.

Here is the RadClientDataSource code
<telerik:RadClientDataSource runat="server" ID="RadClientDataSourceCustomers">
    <DataSource>
        <WebServiceDataSourceSettings>
            <Select DataType="JSON" Url="http://localhost:62671/Customers.asmx/GetCustomers?iCountry=6"  ContentType="application/json; charset=utf-8" RequestType="Get" />
        </WebServiceDataSourceSettings>
    </DataSource>
</telerik:RadClientDataSource>

Here is the MapLayer code
    <telerik:MapLayer Type="Marker" Shape="pin" ClientDataSourceID="RadClientDataSourceCustomers" LocationField="Location">
    <TooltipSettings AutoHide="false" Width="300"
                     Template="<div class='COntainer'><div class='cusName'>#= marker.dataItem.CustomerName #</div></div>">
        <AnimationSettings>
            <OpenSettings Duration="300" Effects="fade:in" />
            <CloseSettings Duration="200" Effects="fade:out" />
        </AnimationSettings>
    </TooltipSettings>
</telerik:MapLayer>

Any thoughts or examples would be useful.
Mohammed
Top achievements
Rank 2
 answered on 19 Jan 2018
2 answers
300 views

I'm trying to fetch the ClientID for a RadGrid control from client side using JavaScript so that I'll be able to bind data to this from the client side.
The RadGrid is present within the RadLightBox and needs to be populated on a button click event. The markup for LightBox looks something like this.
<telerik:RadLightBox ID="RadLightBox1" runat="server">

<Items><telerik:RadLightBoxItemrunat="server"><ItemTemplate><telerik:RadGrid runat="server" ID="lightbox_radgrid"AutoGenerateColumns="false"><MasterTableView><Columns><%-- Columns not shown here --%> </Columns></MasterTableView><ClientSettings><ClientEvents OnCommand="window_radgrid_OnCommand"/></ClientSettings><GroupingSettings CaseSensitive="false" ShowUnGroupButton="true" /></telerik:RadGrid></ItemTemplate></telerik:RadLightBoxItem></Items></telerik:RadLightBox>

This is the partial Javascript Code that I have written. I am able to find upto the RadLIghtBoxItem element but unable to fetch the RadGrid and it's clientID. This method is to be executed on success of a call to a web service to return the data.
function

onSucessCallThis(result, userContext, methodName)

{

 var radWindow = $find('<%= lightbox.ClientID %>');var LightBoxItems = radWindow.get_items(); console.log(LightBoxItems); console.log(LightBoxItems.get_count());var item = LightBoxItems.getItem(0); console.log(item); //Able to fetch LightBoxItemvar radGrid = item.FindControl("lightbox_radgrid"); //Doesn't work

}

I'm not sure if this is the right way to have a radGrid inside a radLightBox. There isn't many examples of this online.

If the code is unreadable here please check this stackoverflow question

http://stackoverflow.com/questions/38481200/finding-the-client-id-for-a-radgrid-inside-a-radlightboxitem-tag-in-a-radlightbo

Frank
Top achievements
Rank 1
 answered on 19 Jan 2018
0 answers
110 views

hi all

i have a formview with radgridview inside of it this grid with client side click event  after i apply RadAjaxManager its not work 

 

 <telerik:RadAjaxManager ID="RadAjaxManager1" runat="server" DefaultLoadingPanelID="RadAjaxLoadingPanel1" UpdateInitiatorPanelsOnly="True">
        <AjaxSettings>
            <telerik:AjaxSetting AjaxControlID="claimformview">
                <UpdatedControls>
                    <telerik:AjaxUpdatedControl   ControlID="claimformview" />
                </UpdatedControls>
            </telerik:AjaxSetting>
            
        </AjaxSettings>
    </telerik:RadAjaxManager>

 <telerik:RadAjaxLoadingPanel RenderMode="Lightweight"  runat="server" ID="RadAjaxLoadingPanel1"></telerik:RadAjaxLoadingPanel>

<asp:FormView ID="claimformview" runat="server" Width="100%" DataKeyNames="CID" DataSourceID="ClaimDB" OnItemCommand="claimformview_ItemCommand" OnDataBound="claimformview_DataBound">
             
            
            <ItemTemplate>

<script type="text/javascript">
        function printV(id, rowIndex) {
          
             var grid = $find("<%= claimformview.FindControl("RadGrid2").ClientID %>"); 
            var rowControl = grid.get_masterTableView().get_dataItems()[rowIndex].get_element();
            grid.get_masterTableView().selectItem(rowControl, true);

            window.radopen("Fileviwer.aspx?FileNo=" + id, "RadWindow1");
            return false;
        }
        
         

       
        </script>

 <telerik:RadGrid ID="RadGrid2" RenderMode="Lightweight" runat="server" Width="50%" DataSourceID="filedb" AutoGenerateColumns="False" CellSpacing="-1" GridLines="Both" OnItemCreated ="RadGrid2_ItemCreated">
                                                
                                                <ClientSettings>
                                                    <Selecting AllowRowSelect="True"></Selecting>

                                                    <Scrolling   UseStaticHeaders="True"></Scrolling>
                                                </ClientSettings>
                                                <MasterTableView DataKeyNames="FileNo" DataSourceID="filedb">
                                                    <Columns>
                                                        <telerik:GridBoundColumn DataField="FileNo" ReadOnly="True" HeaderText="FileNo" SortExpression="FileNo" UniqueName="FileNo" DataType="System.Int32" FilterControlAltText="Filter FileNo column"></telerik:GridBoundColumn>
                                                         <telerik:GridBoundColumn DataField="Ext" HeaderText="Ext" SortExpression="Ext" UniqueName="Ext" FilterControlAltText="Filter Ext column"></telerik:GridBoundColumn>
                                                      
                                                     <telerik:GridTemplateColumn HeaderText="View" Exportable="False" UniqueName="stores" AllowFiltering="False" AllowSorting="False" Groupable="False">
                    <ItemTemplate>
                        <asp:HyperLink ID="EditLink" runat="server" Text="View" ImageUrl ="../Content/img/Preview32x32.png"></asp:HyperLink>
                    </ItemTemplate>
                             <HeaderStyle Width="50px" /> 
                                                         <ItemStyle Width="50px"/>
                                                         <FooterStyle Width="50px" />
                </telerik:GridTemplateColumn> 
                                                    </Columns>
                                                </MasterTableView>

                                            </telerik:RadGrid>

  </ItemTemplate>
                            </asp:FormView>

 

 

protected void RadGrid2_ItemCreated(object sender, GridItemEventArgs e)
        {
            if (e.Item is GridDataItem)
            {
                HyperLink editLink = (HyperLink)e.Item.FindControl("EditLink");
                editLink.Attributes["href"] = "javascript:void(0);";
                editLink.Attributes["onclick"] = String.Format("return printV('{0}','{1}');", e.Item.OwnerTableView.DataKeyValues[e.Item.ItemIndex]["FileNo"], e.Item.ItemIndex);
            }
        }

 

arkan
Top achievements
Rank 2
Iron
 asked on 19 Jan 2018
0 answers
90 views
How do I set RadFilter Filter Container ID at the client level?
Raeshawn
Top achievements
Rank 1
 asked on 18 Jan 2018
1 answer
310 views

I have a RadGrid in an ASP page. The grid is grouped by a column containing organization names. There is also a column containing prices and I want to sum them up in the group footer (and in the grid footer as well). So far so good. I can add Aggregate="Custom" to the column I want to sum.

There is also a column containing checkboxes. I want to exclude the rows where the checkbox is checked. So instead I add Aggregate="Custom" to the column and OnCustomAggregate="rg_CustomAggregate" on the grid. Now I need to implement this method rg_CustomAggregate but I'm struggling with how to actually browse through the rows in order to sum the price in the rows with the unchecked checkboxes.

The base for the method looks like this so far:

protected void rg_CustomAggregate(object sender, GridCustomAggregateEventArgs e)
{
  int sum = 0;
  if (e.Item is GridGroupFooterItem)
  {
    // TODO: The magic.
    e.Result = sum;
  }
  if (e.Item is GridFooterItem)
  {
    // TODO: Som other magic.
    e.Result = sum;
  }
}

Any tips on how the magic should be implemented is gladly accepted. I have had a hard time finding examples of this on the web.

Jonas
Top achievements
Rank 1
 answered on 18 Jan 2018
3 answers
166 views
I am dynamically creating tabs in a RadTabStrip.  Everything was working wonderfully until I started styling the tabs.  I had to remove the default skin (skin="") to style the tabs the way I want.  But now the scroll buttons are gone.  I haven't found any documentation on how to bring them back or style them.

<telerik:RadTabStrip ID="RadTabStrip1" runat="server" MultiPageID="PartyHistorysPages" Skin="" Width="100%" ScrollChildren="true" ScrollButtonsPosition="Right" OnTabClick="RadTabStrip1_TabClick">
MBEN
Top achievements
Rank 2
Veteran
 answered on 17 Jan 2018
0 answers
181 views

Hello!

I have a radGrid and I am doing client-side binding. And I am using  PagerStyle Mode="NextPrevAndNumeric"

So when client changes the pageSize the radgrid disappears

I set property AlwaysVisible to true, but it doesn't work

<PagerStyle Mode="NextPrevAndNumeric" Position="TopAndBottom" PageSizeControlType="RadComboBox" AlwaysVisible="true"></PagerStyle>

Miriam
Top achievements
Rank 1
 asked on 17 Jan 2018
0 answers
51 views

Hello

I have an issue, the radgrid disappears when I change the page size of the grid

 

<PagerStyle Mode="NextPrevAndNumeric" Position="TopAndBottom" PageSizeControlType="RadComboBox"></PagerStyle>

 

Miriam
Top achievements
Rank 1
 asked on 17 Jan 2018
5 answers
558 views
I have a radgrid and the dates should be formatted to display in the proper culture.

I set the culture in the radgrid as follows

<telerik:RadGrid runat="server" ID="rgdGroupOrder" CellSpacing="0" GridLines="None" Culture="en-AU">

The date columns are databound to datetime objects.

<telerik:GridBoundColumn DataField="ScheduleDateTime" DataType="System.DateTime" FilterControlAltText="Filter ScheduleDateTime column"
    HeaderText="Schedule Date/Time" SortExpression="ScheduleDateTime" UniqueName="ScheduleDateTime" >
</telerik:GridBoundColumn>

No matter what I do the datetime formats always appear in the US format (mm/dd/yyyy) when they should be (dd/mm/yyyy).

I would like to apply a standard date format to these columns as well to clean up the way they look.  So the markup will look like this.

<telerik:GridBoundColumn DataField="ScheduleDateTime" DataType="System.DateTime" FilterControlAltText="Filter ScheduleDateTime column"
    HeaderText="Schedule Date/Time" SortExpression="ScheduleDateTime" UniqueName="ScheduleDateTime" DataFormatString="{0:g}">
</telerik:GridBoundColumn>


The only difference is that the DataFormat property is set.

Thanks

Alex
Top achievements
Rank 1
 answered on 17 Jan 2018
0 answers
168 views

Hi.  I'm trying to export data to Excel using BIFF with Telerik version 2016.3.1027.40-.  The data that needs to be included in the spreadsheet is in a detail table with paging.  My code successfully exports data only on the first page displayed on the UI.  I've implemented the suggestion here https://docs.telerik.com/devtools/aspnet-ajax/controls/grid/functionality/exporting/overview#ignorepaging-not-working-on-detailtables-excel-export to disable paging but it didn't work in my case.  Can someone tell me how I can achieve this functionality given this as my view code

 

<telerik:Radgrid Rendermode="Lightweight" ID="RadGrid1" runat="server" showstatusbar="true" autogeneratecolumns="False" AllowFilteringByColumn="True" pagesize="10" allowsorting="True" allowmultirowselection="False" allowpaging="True" Filtertype="Combined"              
onneeddatasource="RadGrid1_NeedDataSource"   oniteminserted="RadGrid1_ItemInserted"               onitemcommand="RadGrid1_ItemCommand" oninsertcommand="RadGrid1_InsertCommand" onupdatecommand="RadGrid1_UpdateCommand"  onitemdatabound="RadGrid1_ItemDataBound" ondetailtabledatabind="RadGrid1_DetailTableDataBind" OnDeleteCommand="RadGrid1_DeleteCommand" Skin="Outlook" OnItemCreated="RadGrid1_ItemCreated" ShowExportToExcelButton="true"               onBiffExporting="RadGrid1_BiffExporting">   
      
<MasterTableView  AutoGenerateColumns="False" UniqueName="CATDESCRIPTION" AllowMultiColumnSorting="True" DataKeyNames="CAT_DESCRIPTION"  PagerStyle-AlwaysVisible="true" EditMode="InPlace" CommandItemDisplay="Top">               
   <DetailTables>                  
      <telerik:GridTableView DataKeyNames="pk" Name="Codes" TableLayout="Auto" EditMode="InPlace" PagerStyle-AlwaysVisible="true" CommandItemDisplay="Top">                       
<CommandItemSettings ShowExportToExcelButton="true" />             
<CommandItemSettings AddNewRecordText="Add Rule" />
Additional code omitted...

 

and this is part of the code-behind:

protected void RadGrid1_ItemCommand(object source, GridCommandEventArgs e) {
  if (e.CommandName.Equals(Telerik.Web.UI.RadGrid.ExportToExcelCommandName)) {              
      RadGrid1.ExportSettings.Excel.Format = GridExcelExportFormat.Biff;
      RadGrid1.ExportSettings.FileName = "Output";
      RadGrid1.ExportSettings.ExportOnlyData = true;
      RadGrid1.ExportSettings.OpenInNewWindow = true;
 
      //disable paging on the main grid for the export operation
      RadGrid1.ExportSettings.IgnorePaging = false;
      //expand detail tables
      RadGrid1.MasterTableView.HierarchyDefaultExpanded = true;
      RadGrid1.MasterTableView.DetailTables[0].HierarchyDefaultExpanded = true;
 
      foreach (GridTableView tbl in RadGrid1.MasterTableView.DetailTables) {
          tbl.HierarchyDefaultExpanded = true;
          //disable paging for the detail grids for the export operation
          tbl.AllowPaging = false;
       }
     }
}
Matthew
Top achievements
Rank 1
 asked on 17 Jan 2018
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?