Telerik Forums
UI for ASP.NET MVC Forum
4 answers
164 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
99 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
150 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
654 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
331 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
244 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.5K+ 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
141 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
378 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
7 answers
1.4K+ views
I need to make a cascading combobox with server filtering but I'm having trouble setting the initial value.The dropdownlist on which the combobox depends looks like this:

1.@(Html.Kendo().DropDownListFor(model => model.SelectedCompany)
2.    .Name("UserDetailSelectedCompany")
3.    .HtmlAttributes(new { style = "width:115px;" })
4.    .BindTo(Model.CompanyList)
5.    .Value(Model.SelectedCompany))
Where:
  • model.SelectedCompany is a string
  • Name attribute is set because I need that in the combobox (I've read on the Kendo UI forums I'm not supposed to specify it, but I don't know how to do the cascading combobox without it)
  • Model.CompanyList is a List<string>
And here's the combobox:

01.@(Html.Kendo().ComboBoxFor(model => model.SelectedDealer)
02.    .Name("UserDetailSelectedDealer")
03.    .DataTextField("Name")
04.    .DataValueField("ID")
05.    .HtmlAttributes(new { style = "width:325px" })
06.    .Filter(FilterType.Contains)
07.    .AutoBind(false)
08.    .Enable(false)
09.    .MinLength(3)
10.    .DataSource(source => source.Read(read => read.Action("GetDealers", "Administration").Data("Administration.GetUserDealerParameters"))
11.                                .ServerFiltering(true))
12.    .CascadeFrom("UserDetailSelectedCompany")
13.    .SelectedIndex(Model.SelectedDealer.ID))
Where:
  • model.SelectedDealer is a Dealer
  • Dealer class contains a Name(string) and an ID (int)
  • MVC action GetDealers return a JSON converted List<Dealer>
Does anyone have an example that demonstrate how I can get this to work? The Kendo UI doc has example for a cascading combobox, server filtering and setting initial value, but not for the 3 at same time.
Daniel
Telerik team
 answered on 29 Sep 2014
Narrow your results
Selected tags
Tags
Grid
General Discussions
Scheduler
DropDownList
Chart
Editor
TreeView
DatePicker
ComboBox
Upload
MultiSelect
ListView
Window
TabStrip
Menu
Installer and VS Extensions
Spreadsheet
AutoComplete
TreeList
Gantt
PanelBar
NumericTextBox
Filter
ToolTip
Map
Diagram
Button
PivotGrid
Form
ListBox
Splitter
Application
FileManager
Sortable
Calendar
View
MaskedTextBox
PDFViewer
TextBox
Toolbar
MultiColumnComboBox
Dialog
DropDownTree
Checkbox
Slider
Switch
Notification
Accessibility
ListView (Mobile)
Pager
ColorPicker
DateRangePicker
Wizard
Security
Styling
Chat
MediaPlayer
TileLayout
DateInput
Drawer
SplitView
Template
Barcode
ButtonGroup (Mobile)
Drawer (Mobile)
ImageEditor
RadioGroup
Sparkline
Stepper
TabStrip (Mobile)
GridLayout
Badge
LinearGauge
ModalView
ResponsivePanel
TextArea
Breadcrumb
ExpansionPanel
Licensing
Rating
ScrollView
ButtonGroup
CheckBoxGroup
NavBar
ProgressBar
QRCode
RadioButton
Scroller
Timeline
TreeMap
TaskBoard
OrgChart
Captcha
ActionSheet
Signature
DateTimePicker
AppBar
BottomNavigation
Card
FloatingActionButton
Localization
MultiViewCalendar
PopOver (Mobile)
Ripple
ScrollView (Mobile)
Switch (Mobile)
PivotGridV2
FlatColorPicker
ColorPalette
DropDownButton
AIPrompt
PropertyGrid
ActionSheet (Mobile)
BulletGraph
Button (Mobile)
Collapsible
Loader
CircularGauge
SkeletonContainer
Popover
HeatMap
Avatar
ColorGradient
CircularProgressBar
SplitButton
StackLayout
TimeDurationPicker
Chip
ChipList
DockManager
ToggleButton
Sankey
OTPInput
ChartWizard
SpeechToTextButton
InlineAIPrompt
TimePicker
StockChart
RadialGauge
ContextMenu
ArcGauge
AICodingAssistant
+? more
Top users last month
Cynthia
Top achievements
Rank 1
Iron
Jesse
Top achievements
Rank 2
Iron
Toby
Top achievements
Rank 3
Iron
Iron
Iron
Danielle
Top achievements
Rank 1
Iron
Iron
Joel
Top achievements
Rank 3
Bronze
Bronze
Iron
Want to show your ninja superpower to fellow developers?
Top users last month
Cynthia
Top achievements
Rank 1
Iron
Jesse
Top achievements
Rank 2
Iron
Toby
Top achievements
Rank 3
Iron
Iron
Iron
Danielle
Top achievements
Rank 1
Iron
Iron
Joel
Top achievements
Rank 3
Bronze
Bronze
Iron
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?