Telerik Forums
UI for ASP.NET MVC Forum
5 answers
141 views
See Attachment, the paging inside the grid of the child somehow goes to the new line for Refresh.  I have  grid which has a child grid, the child grid paging is showing double line.  This paging is fine for IE and Chrome.
Vladimir Iliev
Telerik team
 answered on 02 Oct 2014
4 answers
155 views
Hi Telerik,

I have this requirement that I want to load the details of my a row using your clientemplateid.
I already created my template and it is a kendo tabstrip. it has an item loaded from a partial view here is the code

@(Html.Kendo().TabStrip()
            .Name("tabStrip_#=RowID#")
            .SelectedIndex(0)
            
            .Animation(animation => animation.Open(open => open.Fade(FadeDirection.In)))
            .Items(items =>
            {

                items.Add().Text("Profile Information")
                    .LoadContentFrom("GetPartialApplicantProfile", "SearchProfile", new { rowid = "#=RowID#" })
                    .Selected(true);
                
            })
            .Events(s => s.ContentLoad("DetailLoaded"))
            .ToClientTemplate())

the problem with this is on the initial load of the template when i expand a row it displays the detail perfectly. And after a second the next row below it overriding the display of the template. Why is that happening? Is it the row doesnt detect the size of my template when i loaded it partially?



Mhars
Top achievements
Rank 1
 answered on 02 Oct 2014
1 answer
87 views
Okay so lets try to explain what situation I'm correctly involved in.

I have a Kendo().Grid<>  that is bound to a Dependant Model.

I have a EditorTemplate of the fields required for the editing of this Grids columns within a Popup window. This template has a few dropdowns that get populated with a remote datasource. The normal textboxes updates the model within the grid while the dropdown simply refuses to do so.

I already tried the ValuePrimitive but to no Avail.

Help Please
Nikolay Rusev
Telerik team
 answered on 01 Oct 2014
1 answer
133 views
In my scheduler, I have, as a part of the definition:

.EventTemplate(
       "<p>" +
       "#= kendo.toString(start, 'MMM dd yyyy hh:mm t') # (#= kendo.toString(new Date(end.getTime()-start.getTime()).getHours()) #) #= title#" +
        "</p>")
 

then this runs, I get 

<p>Sep 29 2014 12:00 t (20) Smith, John</p>


20 hours is the value I get for a one hour meeting.
21 hours is the value I get for a two hour meeting.

I would have expected 1 and 2 hours, respectively...

How do I properly calculate total hours between two DateTime values in javascript MVVM?

Vladimir Iliev
Telerik team
 answered on 01 Oct 2014
1 answer
626 views
Hi,

I'm trying to create a cascading drop down list where the child (Order) is still enabled when the parent (Customer) has not been selected, as non selection means All Customers. i.e. the parent is the filter, so when its set to a particular value, the child shows the Orders that belong to that Customer, but when its not selected, the child should show all Orders.

I have tried setting AutoBind to true, but that doesn't seem to help.

Is this possible?

Thanks,

Chris

@(Html.Kendo().DropDownList()
    .Name("Order")
    .DataTextField("Text")
    .DataValueField("Value")
    .DataSource(source =>
    {
        source.Read(read =>
        {
            read.Action("OrderList", "List")
                .Data("filterOrders");
        })
        .ServerFiltering(true);
    })
    .OptionLabel("Please Select")
    .AutoBind(true)
    .CascadeFrom("Customer")
    .Enable(true)

Script
function filterOrders() {
    return {
        customerID: $("#Customer").val()
    };
}

Georgi Krustev
Telerik team
 answered on 01 Oct 2014
5 answers
321 views
Hello,

I have line charts with multiple data (even more than 10.000 points). I see that Kendo UI supports pan and zoom option. Though I found only example code for Html http://demos.kendoui.com/dataviz/bar-charts/pan-and-zoom.html. Is there some kind of example code for MVC ?


Best regards.


Iliana Dyankova
Telerik team
 answered on 30 Sep 2014
2 answers
191 views
I have the Required attribute on my model, but when I use DatePickerFor, Kendo Validator does not pick that up.  If I use the F12 tools and manually add "required='required'" to the input that the DatePicker renders, then Validator picks it up and shows a message next to the picker.  Besides that, it's also not picking up the ErrorMessage on my Required attribute.  I'm assuming I could add another attribute to the <input> for it to pick that up as well, but not yet sure what the attribute name is.  Can you please explain why I can't just get this behavior out of the box, and if this is a bug with the DatePickerFor?  I'd rather not have to use .HtmlAttributes to manually stick these things onto every DatePicker.  Maybe I'm just missing something, but for something like this, you expect it to just work.  Thanks!
Michael
Top achievements
Rank 1
 answered on 29 Sep 2014
4 answers
5.4K+ views
Hi there,

in my case, I have a ViewModel on the client side. It works and shows the data from the "real" model. The real model consists of an object that contains other objects, e.g. ArchivedDoubleValue refers to a Station, which has a name, via its StationId. In my ViewModel, things are flattened in order to be fast and avoid circular dependencies, so there is:

int Id (ArchivedDoubleValue.Id)
double Value (ArchivedDoubleValue.Value)
string StationName (refers to Station.Name and gets set in the controller)

Now, when I want to sort or filter the StationName column, I run into an error, because StationName does not exist in the "real" model, only StationId.

So I thought I could simply "translate" the Member String in DataSourceRequest.Groups and DataSourceRequest.Sorts back into the corresponding Id. That worked quite well:

When grouping in the client, the request.Groups contains an entry with its Member set to "StationName". This is just a string and I change it to the corresponding StationId. Same works well for sorting.

But it DOES NOT work for filtering!  When debugging and peeking into he request at runtime, I can see and change the Filters Members and Values, but when I try to change it via code in the controller, I can not access it:

            if (request.Filters.Count > 0)
            {
                foreach (var f in request.Filters)
                {
                    String fs = f.Member.ToString();

This gives me an error:
Kendo.Mvc.IFilterDescriptor does not contain a definition for "Member"

How am I supposed to filter the "real" data with the filter set to a column in my ViewModel? I wonder how to do that? Or is there a way to access request.Filters? I think that would be the most elegant way to do it as it wiould be transparent to the client.

Please help me with that, thanks in advance!

Regards, Rob
Rosen
Telerik team
 answered on 29 Sep 2014
1 answer
124 views
My Kendo Comboxbox server binding is not working

This is my View
 @(Html.Kendo().ComboBox()
              .Name("cbxState")
              .HtmlAttributes(new { style = "width:150px" })
              .Text("Select State")
     
              .DataTextField("Code")
              .DataValueField("Code")
               .Filter(FilterType.Contains)
              .DataSource(source =>
              {
                  source.Read(read =>
                  {
                      read.Action("cbx_read", "Home");
                  })
                  .ServerFiltering(true);
              })
              )


This is my Controller       

public ActionResult cbx_read([DataSourceRequest]DataSourceRequest request)
         {
             using (var northwind = new Connection())
             {
                 IQueryable<LostDayDetail> Customers = northwind.LostDayDetail;
                 DataSourceResult result = Customers.ToDataSourceResult(request, Customer => new CustomerDetail
                 {
                     Code = Customer.Code,
                     Name = Customer.Name,
                     Days = Customer.Days
                 });
                 return Json(result);
             }
        }

When I click on Combobox, it calls cbx_read function and it gets all 12 rows of data from database table. but when contol comes back to view, the combobox is blank.
Please help me




Georgi Krustev
Telerik team
 answered on 29 Sep 2014
1 answer
347 views
I'm sure this is actually really simple and I'm just making it really complicated, but I could really use a fresh set of eyes on this one.

When a user loads my page with the grid on it, I get the url referrer via JavaScript and analyze it via regex. If the url has a TransactionID (int) in it, I assign it to a JavaScript variable.

Here's my problem: I want to find the row in the grid with that TransactionID and have the grid go right to it (like if it's farther down the grid, I want the grid to scroll down to that row automatically). One way I think I can do this is to focus the row itself, but I can't figure out how to get to it in JavaScript. If I could find the row with the TransactionID, then just call the focus() function, I think that will solve this thing.

Here's what I have. Please help! :(

​
@(Html.Kendo().Grid(Model)
.Name("TransactionGrid")
.DataSource(dataSource => dataSource
    .Server()
    .Model(model => model.Id(o => o.TransactionsTrackingID))
    .PageSize(1000)
)
.Columns(columns =>
{
    columns.Template(
        @<text>
<a href='@Url.Content("~/Transaction/Details/" + @item.TransactionID)' style="cursor:pointer;">
    Details</a>
</text>
    ).Width(53);
    columns.Bound(r => r.TransactionID).Title("ID").Hidden();
    columns.Bound(r => r.MessageType).Filterable(ftb => ftb.Cell(cell => cell.Delay(autoCompleteDelay)));
     
})
.HtmlAttributes(new { style = "width:100%;" })
.Resizable(resizing => resizing.Columns(true))
.Pageable()
.Groupable()
.Filterable(ftb => ftb.Mode(GridFilterMode.Row))
.Sortable(sorting => sorting.Enabled(true))
.Scrollable(s => s.Height(600))
                        )




<script type="text/javascript">
 
 
    $(document).ready(function () {
 
        var referrer = '';
 
        if (document.referrer) {
            referrer = document.referrer;
        }
 
        var re1 = '(Transaction)'; // Alphanum 1
        var re2 = '(\\/)'; // Any Single Character 1
        var re3 = '(Details)'; // Word 1
        var re4 = '(\\/)'; // Any Single Character 2
        var re5 = '(\\d+)'; // Integer Number 1
 
        var p = new RegExp(re1 + re2 + re3 + re4 + re5, ["i"]);
        var m = p.exec(referrer);
 
        if (m !== null) {
            var transactionId = m[5]; //this gets the transactionID
 
            var grid = $("#TransactionGrid")
            grid.ready(function () {
                //The code I will need goes in here. :(
            });
        }
    });
</script>
Nikolay Rusev
Telerik team
 answered on 29 Sep 2014
Narrow your results
Selected tags
Tags
+? more
Top users last month
Jay
Top achievements
Rank 3
Bronze
Iron
Iron
yw
Top achievements
Rank 2
Iron
Iron
Stefan
Top achievements
Rank 2
Iron
Iron
Iron
Kao Hung
Top achievements
Rank 1
Iron
Bohdan
Top achievements
Rank 2
Iron
Iron
Iron
Want to show your ninja superpower to fellow developers?
Top users last month
Jay
Top achievements
Rank 3
Bronze
Iron
Iron
yw
Top achievements
Rank 2
Iron
Iron
Stefan
Top achievements
Rank 2
Iron
Iron
Iron
Kao Hung
Top achievements
Rank 1
Iron
Bohdan
Top achievements
Rank 2
Iron
Iron
Iron
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?