Telerik Forums
UI for ASP.NET AJAX Forum
1 answer
165 views
I'm building a 'sample' project in asp.net MVC for my clients to show them how to interface with our services, and i'm using kendo core which means no MVC wrappers.  Basically i have the javascript:
function loadAttGrid() {
            var attgeturl = "@Url.Action("_GetAttachmentListJSON", "Attachment", new { area = "MVCPlug", id = ViewContext.RouteData.Values["id"] }, null)";
            var attupdateurl = "@Url.Action("_UpdateAttachment", "Attachment", new { area = "MVCPlug", id = ViewContext.RouteData.Values["id"] }, null)";
            var attdeleteurl = "@Url.Action("_DeleteLogEntry", "Attachment", new { area = "MVCPlug", id = ViewContext.RouteData.Values["id"] }, null)";
            $("#attgrid").kendoGrid({
                dataSource: {
                    transport: {
                        read: {
                            url: attgeturl,
                            type: "GET",
                            dataType:"json"
                        },
                        update: {
                            url: attupdateurl,
                            type: "POST",
                            dataType: "json"
                        },
                        destroy: {
                            url: attdeleteurl,
                            type: "POST",
                            dataType: "json"
                        }
                    },
                    parameterMap: function (options, operation) {
                        if (operation !== "read" && options.models) {
                            return { models: kendo.stringify(options.models) };
                        }
                    },
                    pageSize: 10,
                    schema: {
                        model: {
                            id: "LogEntryGUID",
                            fields: {
                                LogEntryGUID: { editable: false },
                                FileName: { editable: false },
                                FriendlyUserName: { editable: false },
                                LocationString: { editable: false },
                                EventDescription: { editable: true },
                                FormattedDateCreated: { type: "date", editable: false }
                            }
                        }
                    }
                },
                selectable: false,
                sortable: true,
                filterable: true,
                editable: "inline",
                pageable: {
                    refresh: false,
                    pageSizes: false,
                    buttonCount: 5
                },
                columns: [
                  { field: 'FileName', title: 'File Name' },
                  { field: 'FriendlyUserName', title: 'User' },
                  { field: 'EventDescription', title: 'Description' },
                  { field: 'FormattedDateCreated', title: 'Date Created', format: "{0:G}" },
                  {
                      command: [
                          //define the commands here
                          { name: "edit", text: " " },
                          { name: "destroy", text: " " }
                      ],
                      title: " ", width: "85px"
                  }
                ]
            });
        }
which works fine when using MVC wrappers, and the 'read' url for the controller looks like 
public ActionResult _GetAttachmentListJSON([DataSourceRequest] DataSourceRequest, Guid id)
        {
            Models.ArrayOfFullLogEntry theAtts = null;
            if (id != Guid.Empty)
            {
                theAtts = GetAttList(id);
            }
            return Json(theAtts.ToDataSourceResult(request), JsonRequestBehavior.AllowGet);
        }
but it does NOT work if i change the controller to not use the wrapper, like:
public ActionResult _GetAttachmentListJSON(Guid id)
        {
            Models.ArrayOfFullLogEntry theAtts = null;
            if (id != Guid.Empty)
            {
                theAtts = GetAttList(id);
            }
            return Json(theAtts, JsonRequestBehavior.AllowGet);
        }
what do i need to change in the javascript to make this wrapper-less controller work?
Mark
Top achievements
Rank 1
 answered on 30 Aug 2016
1 answer
81 views

DropDown loses his position when enlarging the website in a mobile

Se attached image...

It works perfekt in FireFox when i enlarge the website.

Peter Milchev
Telerik team
 answered on 30 Aug 2016
2 answers
98 views
Is it possible, when exporting from the grid control to an Excel file in the XLSX format to specify that it should be printed in landscape?
Robert
Top achievements
Rank 1
 answered on 30 Aug 2016
6 answers
211 views
Hi,
Could anyone advise me please as to how to add addtional comparsion validation to my radgrid below.

I have 2 columns that are required fields: BasketsCaughtTotal and BasketsSampledTotal

I also require that BasketsCaughtTotal must always be equal to or greater than BasketsSampledTotal

<Columns>
                     <telerik:GridBoundColumn DataField="TripCode" FilterControlAltText="Filter TripCode column" HeaderText="Trip Code" SortExpression="TripCode" UniqueName="TripCode" ReadOnly="true"></telerik:GridBoundColumn>
                     <telerik:GridBoundColumn DataField="VesselCode" HeaderText="Vessel" UniqueName="VesselCode" Visible="false" ReadOnly="true"></telerik:GridBoundColumn>
                     <telerik:GridBoundColumn DataField="HaulNumber" HeaderText="Haul" UniqueName="HaulNumber" ReadOnly="true"></telerik:GridBoundColumn>
                     <telerik:GridBoundColumn DataField="RigNumber" HeaderText="Rig"  UniqueName="RigNumber" ReadOnly="true"></telerik:GridBoundColumn>    
                     <telerik:GridBoundColumn DataField="CatchTypeName" HeaderText="Catch Type" UniqueName="CatchTypeName" ReadOnly="true"></telerik:GridBoundColumn>
                     <telerik:GridBoundColumn DataField="CatchTypeCode" HeaderText="Catch Type Code" Visible="false" UniqueName="CatchTypeCode" ReadOnly="true"></telerik:GridBoundColumn>
                     <telerik:GridCalculatedColumn HeaderText="Raising Factor" UniqueName="RaisingFactor" DataType="System.Decimal" DataFormatString="{0:N2}" DataFields="BasketsCaughtTotal, BasketsSampledTotal" Expression="{0}/{1}" />
                     <telerik:GridBoundColumn DataField="BasketsCaughtTotal" HeaderText="Baskets Caught Total" UniqueName="BasketsCaughtTotal" ColumnEditorID="BasketsCaughtTotal" Visible="false" DataType="System.Decimal" DataFormatString="{0:N5}">
                          <ColumnValidationSettings EnableRequiredFieldValidation="True">
                               <RequiredFieldValidator ID="RFTotalBasketsCaught" Font-Bold="True"> Enter baskets caught</RequiredFieldValidator>
                           </ColumnValidationSettings>
                     </telerik:GridBoundColumn>
                     <telerik:GridBoundColumn DataField="BasketsSampledTotal" HeaderText="Baskets Sampled Total" UniqueName="BasketsSampledTotal" ColumnEditorID="BasketsSampledTotal" Visible="false" DataType="System.Decimal" DataFormatString="{0:N5}">
                          <ColumnValidationSettings EnableRequiredFieldValidation="True">
                               <RequiredFieldValidator ID="RFTotalBasketsSampled" Font-Bold="True"> Enter baskets sampled</RequiredFieldValidator>
                           </ColumnValidationSettings>
                     </telerik:GridBoundColumn>
                    </Columns>

Thank you, Ida
Eyup
Telerik team
 answered on 30 Aug 2016
8 answers
621 views
Hi,

I'm using Q2 release of RadFileExplorer with Sharepoint provider and it's really REALLY SLOW. It takes about one or two minutes to show approx 50 doc files.

I set the debug parameter to false, but nothing happend. Any ideas how to speed up the loading? Using IE 7 and IE8 browser.

Thank you very much for your answer

BR

Pavel
Vessy
Telerik team
 answered on 30 Aug 2016
2 answers
42 views

I have an odd problem on the zooming on Stock Chart, the X Axis becomes corrupt.

When I zoom it sorts itself out.

If just plot the points with a default Layout it is OK unzoomed.

I am doing this for both types:

var xAxis = chart.PlotArea.XAxis;

xAxis.Step = Convert.ToDecimal(xAxis.Items.Count * 0.10);
xAxis.BaseUnitStep = Convert.ToInt32(xAxis.Step);
xAxis.BaseUnit = DateTimeBaseUnit.Minutes;
xAxis.EnableBaseUnitStepAuto = false;

Please see attached images.

James
Top achievements
Rank 1
 answered on 30 Aug 2016
7 answers
372 views

Hello,

This new FileExplorer control is very, very, very slow to open folders with a lot of files in Internet Explorer 7. Testing with a folder with 1000 jpg files, 4Kb each file, take more than 5 minutes to open in a machine with Dual Xeon processor and SAS 15K speed disk and causes iexplorer process to consume much cpu.

With Firefox works very fast.

Regards,
Newton

Vessy
Telerik team
 answered on 30 Aug 2016
5 answers
137 views

trying to close the radwindow from javascript causes scroll position error:

var radWindow = $find("<%= RadWindow3.ClientID %>");
    radWindow.close();

 

please help.

 

Marin Bratanov
Telerik team
 answered on 30 Aug 2016
1 answer
141 views

Hi,

My problem goes on like this:I have a radwindow which showsup on button click on the window shows that contains two radgrids in two rows,I am binding data to it.It works fine till here,but when i have applied ajax loading panel for the grid,in page size changed and pahe index changed events the grid was not displaying once  which is in first row,but if i remive loading panel it works fine.

Can any one please help me?

Thanks in advance

Eyup
Telerik team
 answered on 30 Aug 2016
4 answers
211 views

I am facing alignment issue while exporting hierarchical radgrid data to excel. Please find below by code

ASPX

<telerik:RadGrid ID="RadGridCurrencyDetail" runat="server" AutoGenerateColumns="False"
                                    CellSpacing="0" GridLines="None" Width="100%" OnNeedDataSource="RadGridCurrencyDetail_NeedDataSource" OnGridExporting="RadGridCurrencyDetail_GridExporting">
                                    <AlternatingItemStyle Wrap="True" />
                                    <GroupHeaderItemStyle Wrap="True" />
                                    <ClientSettings AllowExpandCollapse="true">
                                    </ClientSettings>
                                     <ExportSettings ExportOnlyData="true" OpenInNewWindow="true" />
                                    <MasterTableView AllowMultiColumnSorting="false" AutoGenerateColumns="false" TableLayout="Fixed"
                                        AllowFilteringByColumn="false" AllowSorting="false" IsFilterItemExpanded="false"
                                        NoMasterRecordsText="No currency records in this Queue" DataKeyNames="BucketID,BucketID"
                                        HierarchyLoadMode="Client" HierarchyDefaultExpanded="true">
                                        <%--<ExpandCollapseColumn Visible="True" FilterControlAltText="Filter ExpandColumn column">
                                            <HeaderStyle Width="3%"></HeaderStyle>
                                        </ExpandCollapseColumn>--%>
                                        <Columns>
                                            <telerik:GridTemplateColumn DataField="BucketName" FilterControlAltText="BucketName"
                                                HeaderText="Bucket" UniqueName="BucketName">
                                                <ItemTemplate>
                                                    <asp:Label ID="lblBucketName" runat="server" Text='<%# DataBinder.Eval(Container.DataItem, "BucketName")%>'></asp:Label>
                                                </ItemTemplate>
                                               

                                                 <ItemStyle HorizontalAlign="Left" CssClass="SlimCell" Wrap="false" />
                                                 <HeaderStyle CssClass="OTCs_gridHeader_left" ForeColor="Black" Font-Bold="true"
                                                  HorizontalAlign="Left" Width="25%" />
                                            </telerik:GridTemplateColumn>

                                            <telerik:GridTemplateColumn DataField="Broker" DataType="System.Decimal" FilterControlAltText="Filter Broker column"
                                                UniqueName="BrokerValue" HeaderText="Broker">
                                                <ItemTemplate>
                                                    <asp:Label ID="lblBroker" runat="server" Text='<%# DataBinder.Eval(Container.DataItem, "BrokerValue")%>'></asp:Label><%--C1---%>
                                                </ItemTemplate>
                                                <ItemStyle HorizontalAlign="Right" CssClass="SlimCell" Wrap="false" />
                                                <HeaderStyle CssClass="OTCs_gridHeader_left" ForeColor="Black" Font-Bold="true"
                                                    HorizontalAlign="Left" Width="25%" />
                                            </telerik:GridTemplateColumn>

                                            <telerik:GridTemplateColumn DataField="System" DataType="System.Decimal" FilterControlAltText="Filter System column"
                                                HeaderText="System" UniqueName="SystemValue">
                                                <ItemTemplate>
                                                    <asp:Label ID="lblSystem" runat="server" Text='<%# DataBinder.Eval(Container.DataItem, "SystemValue")%>'></asp:Label>
                                                    <%--C1---%>
                                                </ItemTemplate>
                                                <ItemStyle HorizontalAlign="Right" CssClass="SlimCell" Wrap="false" />
                                                <HeaderStyle CssClass="OTCs_gridHeader_left" ForeColor="Black" Font-Bold="true"
                                                    HorizontalAlign="Left" Width="25%" />
                                            </telerik:GridTemplateColumn>
                                            <telerik:GridTemplateColumn DataField="TotalDiff" FilterControlAltText="TotalDiff"
                                                HeaderText="Difference" UniqueName="TotalDiff">
                                                <ItemTemplate>
                                                    <asp:Label ID="lblTotalDiff" runat="server" Text='<%# DataBinder.Eval(Container.DataItem, "TotalDiff")%>'></asp:Label>
                                                </ItemTemplate>
                                                <ItemStyle CssClass="cItem" HorizontalAlign="right" VerticalAlign="Top" />
                                                <HeaderStyle Width="25%" VerticalAlign="Top" CssClass="OTCs_gridHeader_left" HorizontalAlign="Left"
                                                    Font-Bold="true" ForeColor="Black" />
                                            </telerik:GridTemplateColumn>
                                        </Columns>
                                        <NestedViewSettings>
                                            <ParentTableRelation>
                                                <telerik:GridRelationFields DetailKeyField="BucketID" MasterKeyField="BucketID" />
                                            </ParentTableRelation>
                                        </NestedViewSettings>
                                        <NestedViewTemplate>
                                            <table cellpadding="0" cellspacing="0" style="width: 100%; text-align: center; background-color: #CEE3F6;">
                                                <tr valign="top">
                                                    <td valign="top">
                                                        <telerik:RadGrid ID="RadGridCurrencyDetailInner" OnNeedDataSource="RadGridCurrencyDetailInner_NeedDataSource"
                                                            runat="server" AllowSorting="false" AllowPaging="false" ShowStatusBar="true"
                                                            Width="100%">
                                                             <ExportSettings ExportOnlyData="true" OpenInNewWindow="true" />
                                                            <MasterTableView AllowMultiColumnSorting="false" AutoGenerateColumns="false" TableLayout="Fixed"
                                                                AllowFilteringByColumn="false" AllowSorting="false" IsFilterItemExpanded="false"
                                                                DataKeyNames="BucketId">
                                                                <Columns>
                                                                    <telerik:GridBoundColumn AllowFiltering="false" DataField="KeyValue" FilterControlAltText="Filter KeyValue column"
                                                                        HeaderText="KeyValue" UniqueName="KeyValue" Display="false">
                                                                        <ItemStyle />
                                                                        <HeaderStyle  />
                                                                    </telerik:GridBoundColumn>
                                                                    <telerik:GridTemplateColumn AllowFiltering="false" DataField="Activities" FilterControlAltText="Filter Activities column"
                                                                        HeaderText="Activities" UniqueName="Activities">
                                                                        <ItemTemplate>
                                                                            <asp:Label ID="lblActivities" runat="server" Text='<%# DataBinder.Eval(Container.DataItem, "Activities")%>'></asp:Label>
                                                                            &nbsp;
                                                                <asp:HyperLink ID="hypVarianceManagement" CssClass="SlimItem" runat="server" Target="_self"
                                                                    ForeColor="blue" Visible="false">[ Variance Management ]</asp:HyperLink>
                                                                            &nbsp;
                                                                <asp:HyperLink ID="HypHoldingsNPV" CssClass="SlimItem" runat="server" Target="_self"
                                                                    ForeColor="blue" Visible="false">[ Holdings / NPV ]</asp:HyperLink>
                                                                            &nbsp;
                                                                <asp:Image ID="AttentionImage" runat="server" Visible="False" />
                                                                        </ItemTemplate>
                                                                        <ItemStyle HorizontalAlign="Left" CssClass="SlimCell" Wrap="false" />
                                                                        <HeaderStyle CssClass="OTCs_gridHeader_left" ForeColor="Black" Font-Bold="true"
                                                                            HorizontalAlign="Left" Width="25%" />
                                                                    </telerik:GridTemplateColumn>
                                                                    <telerik:GridTemplateColumn DataField="Broker" DataType="System.Decimal" FilterControlAltText="Filter Broker column"
                                                                        UniqueName="BrokerValue" HeaderText="Broker">
                                                                        <ItemTemplate>
                                                                            <asp:Label ID="lblBroker" runat="server" Text='<%# SetText(Eval("KeyValue"), Eval("BrokerValue")) %>'></asp:Label><%--C1---%>
                                                                        </ItemTemplate>
                                                                        <ItemStyle HorizontalAlign="Right" CssClass="SlimCell" Wrap="false" />
                                                                        <HeaderStyle CssClass="OTCs_gridHeader_left" ForeColor="Black" Font-Bold="true"
                                                                            HorizontalAlign="Left" Width="25%" />
                                                                    </telerik:GridTemplateColumn>
                                                                    <telerik:GridTemplateColumn DataField="System" DataType="System.Decimal" FilterControlAltText="Filter System column"
                                                                        HeaderText="System" UniqueName="SystemValue">
                                                                        <ItemTemplate>
                                                                            <asp:Label ID="lblSystem" runat="server" Text='<%# SetText(Eval("KeyValue"), Eval("SystemValue")) %>'
                                                                                Visible='<%# SetVisibility(Eval("KeyValue")) %>'></asp:Label>
                                                                            <%--C1---%>
                                                                        </ItemTemplate>
                                                                        <ItemStyle HorizontalAlign="Right" CssClass="SlimCell" Wrap="false" />
                                                                        <HeaderStyle CssClass="OTCs_gridHeader_left" ForeColor="Black" Font-Bold="true"
                                                                            HorizontalAlign="Left" Width="25%" />
                                                                    </telerik:GridTemplateColumn>
                                                                    <telerik:GridTemplateColumn DataType="System.Decimal" HeaderText="Difference" UniqueName="VarDifference">
                                                                        <ItemTemplate>
                                                                            <asp:Label ID="lblDifference" runat="server" Text='<%# SetText(Eval("KeyValue"), Eval("VarDifference")) %>'
                                                                                Visible='<%# SetVisibility(Eval("KeyValue")) %>'></asp:Label>
                                                                            <%--C1---%>
                                                                        </ItemTemplate>
                                                                        <ItemStyle HorizontalAlign="Right" CssClass="SlimCell" Wrap="false" />
                                                                        <HeaderStyle CssClass="OTCs_gridHeader_left" ForeColor="Black" Font-Bold="true"
                                                                            HorizontalAlign="Left" Width="25%" />
                                                                    </telerik:GridTemplateColumn>
                                                                </Columns>
                                                            </MasterTableView>
                                                        </telerik:RadGrid>
                                                    </td>
                                                </tr>
                                            </table>
                                        </NestedViewTemplate>
                                    </MasterTableView>
                                    <HeaderStyle Font-Bold="true" HorizontalAlign="Center" />
                                </telerik:RadGrid>
VB
Protected Sub rtbOTCCurrencyDetails_ButtonClick(ByVal sender As Object, ByVal e As Telerik.Web.UI.RadToolBarEventArgs)
        Dim ExStruct As Telerik.Web.UI.ExportInfrastructure.ExportStructure = Nothing
        Dim renderer As Telerik.Web.UI.ExportInfrastructure.XlsBiffRenderer = Nothing
        Dim renderedBytes As Byte() = Nothing

        Try
            
            'RadGridCurrencyDetail.ExportSettings.ExportOnlyData = True
            RadGridCurrencyDetail.ExportSettings.IgnorePaging = True
            RadGridCurrencyDetail.ExportSettings.OpenInNewWindow = True
            RadGridCurrencyDetail.ExportSettings.FileName = "fileName"
            RadGridCurrencyDetail.ExportSettings.Excel.Format = GridExcelExportFormat.Html
            RadGridCurrencyDetail.ExportSettings.HideStructureColumns = True
            RadGridCurrencyDetail.MasterTableView.ExportToExcel()
        Catch
            Throw
        End Try

    End Sub


Please do the neddful for same.

Pavlina
Telerik team
 answered on 29 Aug 2016
Narrow your results
Selected tags
Tags
+? more
Top users last month
Will
Top achievements
Rank 2
Iron
Motti
Top achievements
Rank 1
Iron
Hester
Top achievements
Rank 1
Iron
Bob
Top achievements
Rank 3
Iron
Iron
Veteran
Thomas
Top achievements
Rank 2
Iron
Want to show your ninja superpower to fellow developers?
Top users last month
Will
Top achievements
Rank 2
Iron
Motti
Top achievements
Rank 1
Iron
Hester
Top achievements
Rank 1
Iron
Bob
Top achievements
Rank 3
Iron
Iron
Veteran
Thomas
Top achievements
Rank 2
Iron
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?