Telerik Forums
UI for ASP.NET MVC Forum
5 answers
130 views
Is there a sample for using  returned by a controller as the MVC PivotGrid ?  I can't seem to get data to load in the although I see the getting fetched.
Nikolay
Telerik team
 answered on 13 Apr 2020
9 answers
2.9K+ views

I currently have a kendo grid defined using Razor with read & update actions. It seems that, by default, the update action sends data as a url encoded string (application/x-www-form-urlencoded). Is there a way to set the datasource's update/create/delete actions to post json data instead. 

I ask because our grid rows contain nested objects used in business logic and we've found that the model binding process is really slow on a url encoded string, and very fast when we send the data as a json string (tested in a seperate ajax call).

Aleksandar
Telerik team
 answered on 13 Apr 2020
6 answers
242 views

I have an AnalysisServices Server Installed and i have created a cube in it. I need to add a pivotgrid into my site for browsing said cube.
My site is done using MVC controls and i have added an MVC Pivotgrid using the code below:

@(Html.Kendo().PivotGrid()
        .Name("pivotgrid")
        .ColumnWidth(200)
        .Height(570)
        .Filterable(true)
        .Sortable()
        .Configurator("#configurator")
        .DataSource(dataSource => dataSource
            .Custom()
            .Transport(transport => transport
                .Connection(connection => connection
                .Catalog("CatalogName")
                .Cube("CubeName"))
                //.Read(read => read
                //    .Url("RDC-35")
                //)
            )
            .Events(e => e.Error("onError"))
        )
)

 But i cannot understand where to put the server name. As far as i can tell i need to use .Read(x => x.Url("http://blah.blah") ). and that i need to have an http address for my server installed, as mentioned here: http://docs.telerik.com/kendo-ui/web/pivotgrid/overview

The PivotDataSource component communicates with OLAP cube instance on HTTP using the XMLA protocol
Is this the only way? Can't i use Adomd or ADO.NET?

 

P.S. i have found examples with code like the one below that imply using adomd is an option:

 <AdomdConnectionSettings Cube="Adventure Works" DataBase="Adventure Works DW 2008R2" ConnectionString="Data Source=http://demos.telerik.com/olap/msmdpump.dll;Catalog=Adventure Works DW 2008R2"></AdomdConnectionSettings>

Please forgive me if i have misunderstood anything, i am new to your controls and doing my best to understand them and start using them

Tsvetomir
Telerik team
 answered on 10 Apr 2020
1 answer
306 views

I had this working at one point for a demo... maybe something changed?  But, now I'm baking this into my site for real and pulling a PDF from Azure.  I verify that I'm getting the stream.  Do I have the correct return type?

if (currentContainer.Container == null)
{
    var containerResponse =
        await containerClient.GetAsync(
            currentContainer.ContainerId);
    if (containerResponse.IsSuccess)
    {
        currentContainer.Container =
            containerResponse.Result;
    }
}
if (currentContainer.Container != null)
{
    CloudStorageAccount storageAccount =
        CloudStorageAccount.Parse(
            Glossary.Container.StorageAccountUrl);
    CloudBlobClient blobClient =
        storageAccount.CreateCloudBlobClient();
    CloudBlobContainer container =
        blobClient.GetContainerReference(
            currentContainer.Container.Name);
    if (await container.ExistsAsync())
    {
        CloudBlockBlob blob =
            container.GetBlockBlobReference(
                currentContainer.Path);
        if (await blob.ExistsAsync())
        {
            // pull the zip file into memory
            // load the zipFileStream from the blob
            MemoryStream stream = new MemoryStream();
            await blob.DownloadToStreamAsync(stream);
            return new FileStreamResult(stream, "application/pdf");
        }
        else
        {
            throw new Exception("File not found in Azure container for this record");
        }
    }
    else
    {
        throw new Exception(
            $"Unable to capture Azure container: {currentContainer.Container.Name}");
    }
}
else
{
    throw new Exception($"Unable to capture recorded container for this file.");
}

Ivan Danchev
Telerik team
 answered on 09 Apr 2020
1 answer
232 views

Hi,

With the latest version of kendo (2020.1.219), with numerictexbox, when you type the decimal with the '.' on the numeric keypad, it is blocked and is not replaced by the decimal character which depends on the culture (the comma in my case), unlike previous versions.

Test performed on: https://demos.telerik.com/aspnet-mvc/numerictextbox/globalization

What solution do we have?

 

 

Regards

 

Silviya Stoyanova
Telerik team
 answered on 08 Apr 2020
3 answers
534 views

I have a multiselect that I am using to filter the data for a graph. When I select a small number of items from the multiselect everything is working properly. However, when I select 1100 items from the multiselect, the DataSourceRequest is null. Is there a data limit that I have hit? Can I get pass it and actually pass all 1100 item?

I have attached screenshots for context. And here is the .Read call

.Read(read => read.Action("SampleMethodTest", "MyController").Data("MultiSelectFilterValue"))

 

Thanks,

Ricky

 

 

 

Ricky
Top achievements
Rank 1
 answered on 07 Apr 2020
5 answers
752 views

I have a MVC page with a kendo grid.  The data is already available so I am using server binding.  What I am trying to accomplish is in presenting all of the data needed in the DetailTemplate option.  I am trying with no success to display multiple layers of grids in the DetailTemplate.

I first have a grid on the page showing the data for a ServiceLine.  This grid has a DetailTemplate with a tabstrip.  The first tab strip shows service line data and the second tab strip shows data for other insurance (which is a grid).  This displays correctly for the user when selecting the detail icon.  Both the service line data and the other insurance grid is displayed.

The grid showing other insurance also has a Detail Template showing a grid of adjustments.  This is where the problems resides.  The other insurance grid does show the icon for the detail but the third grid for adjustments does not show when the user clicks on the detail icon.  I am not sure what is incorrect in defining the DetailTemplate for the adjustments grid. 

If you have any ideas or samples of server binding grid details for multiple layers deep would be helpful.  If not I will have to look at other methods (ClientTemplates?) to solve this issue.

Here is the MVC cshtml page:

@inherits BaseRazorView<List<DentalServiceLineModel>>
    @{ Html.Kendo().Grid(Model)
        .Name("DentalServiceLinesGrid")
        .HtmlAttributes(new { @class = "editor-grid" })
        .Columns(columns =>
        {
            columns.Bound(e => e.LineNumber).Title("#").Width("8%");
            columns.Bound(e => e.FromDate).Title("From Date").Width("8%");
            columns.Bound(e => e.ProcedureCode.FormattedText).Title("Procedure Code");
            columns.Bound(e => e.ToothNumber.FormattedText).Title("Tooth Number");
            columns.Bound(e => e.Units).Title("Units").Width("10%");
            columns.Bound(e => e.ChargeAmount).Title("ChargeAmount").Width("15%");
        })
        .Scrollable()
        .DetailTemplate(e =>
        {
            Html.Kendo().TabStrip()
                .Name("slTabStrip_" + e.LineNumber)
                .SelectedIndex(0)
                .Items(items =>
                {
                    items.Add().Text("Service Line Details").Content(@<text>
                        @RenderServiceLineInformation(e)
                    </text>);
                    items.Add().Text("Other Insurance").Content(@<text>
                        @RenderServiceLineOtherInsurances(e.LineNumber, e.OtherInsurances)
                    </text>);
                })
            .Render();
        })
        .DataSource(dataSource => dataSource.Server())
        .NoRecords("No Data")
        .Render();
    }

@helper RenderServiceLineInformation(DentalServiceLineModel dentalServiceLine)
{
<div id="serviceLine_@dentalServiceLine.LineNumber">
    <div class="row">
        <div class="col-md-5 editor-col">
            <div class="editor-label">Procedure Code</div>
            <div class='editor-field font-weight-bold editor-clear'>@dentalServiceLine.ProcedureCode.FormattedText</div>
        </div>
        <div class="col-md-5 editor-col">
            <div class="editor-label">Additional Procedure Code Description</div>
            <div class='editor-field font-weight-bold editor-clear'>@dentalServiceLine.ProcedureCodeAdditionalInfo</div>
        </div>
    </div>
</div>
}

@helper RenderServiceLineOtherInsurances(int serviceLineNumber, List<OtherInsuranceServiceModel> serviceLineOtherInsurances)
{
    @(Html.Kendo().Grid(serviceLineOtherInsurances)
        .Name("DentalServiceLinesGrid_OtherInsurances_" + serviceLineNumber)
        .Columns(columns =>
        {
            columns.Bound(o => o.LineNumber).Title("#").Width("3%");
            columns.Bound(e => e.Carrier.Name).Title("Other Carrier");
            columns.Bound(e => e.PaidAmount).Title("Paid Amount").Width("15%");
            columns.Bound(e => e.PaidDate).Title("Paid Date").Width("10%");
            columns.Bound(e => e.Units).Title("Units").Width("10%");
            columns.Bound(e => e.PatientLiabilityAmount).Title("Patient Liability").Width("20%");
        })
        .Scrollable()
        .DetailTemplate(soi =>
        {
            Html.Kendo().Grid(soi.Adjustments)
                .Name("DentalServiceLinesGrid_OtherInsurances_Adjustments_" + soi.Adjustments)
                .Columns(columns =>
                {
                    columns.Bound(c => c.LineNumber).Title("#").Width("3%");
                    columns.Bound(c => c.GroupCode.Name).Title("Group Code");
                    columns.Bound(c => c.ReasonCode.Name).Title("ReasonCode");
                    columns.Bound(c => c.Amount).Title("Amount").Width("14%");
                    columns.Bound(c => c.Units).Title("Units").Width("14%");
                })
                .Scrollable()
                .NoRecords("No Data");
        })
        .Scrollable()
        .NoRecords("No Data")
    )
}

 

Viktor Tachev
Telerik team
 answered on 07 Apr 2020
10 answers
1.0K+ views
I have grid of orders with popup editor.

I need to add another grid inside popup editor with inline editing of grid items but it doesn't work - empty object is send to action and after trying to add item into grid it is not possible to submit popup window.

Is this approach possible?
Alex Hajigeorgieva
Telerik team
 answered on 07 Apr 2020
11 answers
292 views
Hi, everyone,
I'm trying to change the text of ( Today, Day, TimeLine, TimeLineWeek, Month, Agenda, . . . . ).

Thanks in Advance
I'll drop a picture here to be more specific about what I want to know.
Veselin Tsvetanov
Telerik team
 answered on 06 Apr 2020
9 answers
1.3K+ views
I have searched the doc, stackoverflow and the forum, there are many posts about JSon -> Grid issues discussed and resolved, but I couldn't really apply the approach and solve my problems from these.  Have spent days on it, so, please help.

Basically I have a Grid, I am currently binding data to it with ViewBag, which is working fine.

==== controller ===

ViewBag.locationInProfile = [ a method call which returns an array of  "LocationsInProfile" object]
-- definition of the LocationsInProfile object can be found below from the sample JSon data

==== Grid that works ====
@(Html.Kendo().Grid((IEnumerable<MyNameSpace.Services.LocationsInProfile>)ViewBag.locationInProfile)
            .Name("grid")
            .Columns(columns =>
                     {
                         columns.Bound(location => location._PrimaryText).Title("Primary Location");
                         columns.Bound(location => location._SecondaryText).Title("Secondary Location");
                         columns.Command(command => command.Custom("Remove").Click("RemoveLocation"));
                     }
                  )
            .Pageable()
            .HtmlAttributes(new { style = "height:380px;" })
            .Scrollable()
            .Sortable()
            .Pageable(pge => pge
                .Refresh(true)
                .PageSizes(true)
                )
            )



==== Json controller ====
 - works fine when called directly
 - in debug, can see the Grid is making request to the controller with non-empty array returned

public JsonResult ListLocationsInProfileClientID(int id)
        {
            LocationsInProfile[] res = bbc.ListLocationsInProfileClientID(id);
            return Json(res, JsonRequestBehavior.AllowGet);
        }


sample Json returning
[{"_id":3,"_ClientID":3,"_PrimaryLocation":5,"_SecondaryLocation":0,"_status":1,"_priority":1,"_PrimaryText":"San Jose","_SecondaryText":"None"},{"_id":1,"_ClientID":3,"_PrimaryLocation":6,"_SecondaryLocation":0,"_status":1,"_priority":1,"_PrimaryText":"Sydney","_SecondaryText":"None"},{"_id":6,"_ClientID":3,"_PrimaryLocation":6,"_SecondaryLocation":7,"_status":1,"_priority":1,"_PrimaryText":"Sydney","_SecondaryText":"Tokyo"}]

==== Json controller with DataSourceRequest ====
 - works fine when called directly
 - in debug, can see the Grid is making request to the controller with non-empty array returned

public JsonResult KendoListLocationsInProfileClientID([DataSourceRequest] DataSourceRequest request, int id)
        {
            LocationsInProfile[] res = bbc.ListLocationsInProfileClientID(id);
            return Json(res, JsonRequestBehavior.AllowGet);
        }


sample Json returning

[{"_id":3,"_ClientID":3,"_PrimaryLocation":5,"_SecondaryLocation":0,"_status":1,"_priority":1,"_PrimaryText":"San Jose","_SecondaryText":"None"},{"_id":1,"_ClientID":3,"_PrimaryLocation":6,"_SecondaryLocation":0,"_status":1,"_priority":1,"_PrimaryText":"Sydney","_SecondaryText":"None"},{"_id":6,"_ClientID":3,"_PrimaryLocation":6,"_SecondaryLocation":7,"_status":1,"_priority":1,"_PrimaryText":"Sydney","_SecondaryText":"Tokyo"}]

=================================================
Grid that would like to get working but never load any data from the controller, though in debug, we see the Grid is calling the controller action correctly and the controller is returning non-empty data array, but the Grid is n't showing anything.

@(Html.Kendo().Grid<MyNameSpace.Services.LocationsInProfile>()
    .Name("grid")
    .Columns(columns => {
        columns.Bound(location => location._PrimaryText).Title("Primary Location");
        columns.Bound(location => location._SecondaryText).Title("Secondary Location");
        columns.Command(command => command.Custom("Remove").Click("RemoveLocation"));
    })
    .Pageable()
    .Sortable()
    .Scrollable()
    .Filterable()
    .HtmlAttributes(new { style = "height:430px;" })
    .DataSource(dataSource => dataSource
        .Ajax()
        .PageSize(20)
        .Read(read => read.Action("KendoListLocationsInProfileClientID/" + ViewBag.clientID, "BackupRest"))
     )
)


Any help would be very much appreciated.  I believe that it is just a small issue, but without the experience and knowing the right things to tweak, it is taking a lot of our time and effort to get it working.

Thanks in advance.





Ivan Danchev
Telerik team
 answered on 03 Apr 2020
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?