Hello.
I'm having some troubles with some grids in Internet Explorer and Mozilla Firefox. I have noticed that the filters windows, the datepickers and dropdowns inside the rows don't appear in the correct position. Those try to appear at the bottom of the page instead of when they should be. Sometimes that makes them to appear and disappear in an instant. This happens when the window is small or the grid is at the bottom of the window. When the window is big there's no problem.
In the browsers Google Chrome and in Opera works perfectly.
I think maybe I have a css/javascript conflict or I'm mising some css/js file.
Thank you.
I have a grid that I am using the pop-up editing in. I am using a custom template with drop-downs. The drop-downs have an "Other" option that when selected shows a textbox that you can enter the "Other" details in. This was all in a regular form before I added it to a grid for entry. So I have code for custom validation that would validate these fields if they were showing that worked in a regular form. However, since moving them into the grid pop-up editor, the custom validation is not firing for some reason.
I'm unsure what to do, I have tried to hook the validator up to the grid like so:
$(
"#DeviceGrid"
).kendoValidator({
rules: {
otherrequired:
function
(input) {
if
(input.is(
"[data-val-otherrequired]"
)) {
var
iVal = input.val();
var
pFld = $(
"[name='"
+ input.attr(
"data-val-otherrequired-parentfield"
) +
"_input']"
);
if
(input[0].id ===
"DevicePhoneNum"
) {
if
(pFld.val().toLowerCase().indexOf(
"phone"
) >= 0 && iVal ===
""
) {
return
false
;
}
}
if
(pFld.val() ===
"Other"
&& iVal ===
""
) {
return
false
;
}
}
return
true
;
}
},
messages: {
otherrequired:
function
(input) {
return
input.attr(
"data-val-otherrequired"
);
}
},
validateOnBlur:
true
});
But I'm not sure that this is even the correct way of going about it.
Any insight into this would be appreciated!
Thanks,
Dustin
we have this kind of problem:
We have a database situation as described in the attached screenshot: We have one Request Table, one User Table and an Assignment Table that manage the many to many relationship of the first two tables.
We also have a kendoGrid bounded to the Request Table, and we need to filter data showing only the Request assigned to a specific user.
We are trying to use datasouce.filter (http://docs.telerik.com/kendo-ui/api/javascript/data/datasource#configuration-filter) but we can only filter fields from the Request Table and not from the Assignment Table.
Is there a way to filter a grid using field from a related table?
Any answers will'be a great help for us.
Thank you.
I would like to be able to auto expand (or just increase) the row height on the Scheduler month view to accommodate days that have multiple events. Right now it gets cut off and you have to switch to day view to see all the events. Is there a CSS style tag I can change to adjust this?
I'm hoping this is possible as we are allowing end users to optionally set the min and max value axis amounts. I would like the chart itself to set either or both the Min or Max if the decimal? field is null. Right now I'm using the following code snippet:
.ValueAxis(x => x.Numeric()
.Min(Model.YAxisRangeMin.GetValueOrDefault())
.Max(Model.YAxisRangeMax.GetValueOrDefault()))
This works fine if the decimal? fields have values, but if they are null, the defaults are set to 0, which is not good.
Problem is, I really only want to set a Min/Max value if it is not null. Any ideas how to do that within the control? Am I going to have to calculate the max on the server and use that as the default for the YAxisRangeMax if null? Min as 0 is fine.
Thanks!
I am at a loss on this. <br> I am trying to add a Kendo dropdown user control to a column in my kendo grid.
My View Model:
public class MainViewModel
{
[Display(Name = "Main")]
[Required]
public string Main1 { get; set; }
public string Description { get; set; }
[UIHint("CustomerList")]
public CustomerViewModel Customer { get; set; }
}
public class CustomerViewModel
{
public string CustomerID { get; set; }
public string CustomerName { get; set; }
}
My Grid looks like:
@(Html.Kendo().Grid<Test.Models.MainViewModel>()
.Name("mainGrid")
.Columns(col =>
{
col.Bound(x => x.Main1);
col.Bound(x => x.Customer).ClientTemplate("#=Customer.CustomerName#").Width(180);
col.Bound(x => x.Contact1);
col.Command(x => { x.Edit(); x.Destroy(); });
})
)
The Customer displays in the grid however when I go to add/edit I do not see that column. I don't believe that its calling my user control. <br>I am not sure why.
This user control is in the Views folder. I also tried moving it into the Views>Shared and the Views>Shared>DisplayTemplate folder.
My user control:
<%@ Control Language="C#" Inherits="System.Web.Mvc.ViewUserControl<Main.Models.CustomerViewModel>" %>
<%= Html.Kendo().DropDownListFor(m => m)
.DataValueField("CustomerID")
.DataTextField("CustomerName")
.BindTo((System.Collections.IEnumerable)ViewData["customers"])
%>
This is almost identical to the Kendo example they provide with the only difference is that they have areas setup in their project and I do not.
This is probably a really ignorant question but I'm trying to make my Popup Editor Template 4 columns wide vs the default 2. I have looked at this --> custom-popup-editor and this -->Forum Search
Ideally I could use Bootstrap to setup that template however I wish but I cannot get the very basic `<div class="row"> <div class="col-md-4">` to work. I am currently looking at this --> Kendo and Bootstrap Docs to try and make that work.
At the end of the day I just need to be able to make my Popup Editor 4 columns wide(i.e. label - editor - label - editor) Don't care how I get there.
This is my Editor Template, _Staff.cshtml, and below that is the Index.cshtml that has the Grid that calls it.
@model MyApp.Models.StaffViewModel
@Html.HiddenFor(m => m.StaffID)
<
div
class
=
"row"
>
<
div
class
=
"col-lg-2"
>
@Html.LabelFor(m => m.GPEmployeeID)
</
div
>
<
div
class
=
"col-lg-4"
>
@Html.EditorFor(m => m.GPEmployeeID)
@Html.ValidationMessageFor(m => m.GPEmployeeID)
</
div
>
<
div
class
=
"col-lg-2"
>
@Html.LabelFor(m => m.FirstName)
</
div
>
<
div
class
=
"col-lg-4"
>
@Html.EditorFor(m => m.FirstName)
@Html.ValidationMessageFor(m => m.FirstName)
</
div
>
</
div
>
@(Html.Kendo().Grid<
MyApp.Models.StaffViewModel
>()
.Name("grid")
.Columns(columns =>
{
columns.Bound(c => c.GPEmployeeID);
columns.Bound(c => c.UserID);
columns.Bound(c => c.LastName);
columns.Bound(c => c.FirstName);
columns.ForeignKey(c => c.PrimaryCountyID,(System.Collections.IEnumerable)ViewData["Counties"],"CountyID","CountyName");
columns.Bound(c => c.WorkPhone);
columns.Bound(c => c.WorkEmail);
columns.ForeignKey(c => c.OfficeID,(System.Collections.IEnumerable)ViewData["Offices"],"OfficeID","OfficeName");
columns.ForeignKey(c => c.StaffTypeID,(System.Collections.IEnumerable)ViewData["StaffTypes"],"StaffTypeID","StaffType");
columns.Command(command => { command.Edit(); command.Destroy(); }).Width(110);
})
.ToolBar(toolbar => {
toolbar.Create();
})
.ColumnMenu()
.Editable(editable => editable.Mode(GridEditMode.PopUp).TemplateName("_Staff"))
.Pageable()
.Groupable()
.Sortable(sortable => {
sortable.SortMode(GridSortMode.SingleColumn);
})
.Filterable(ftb => ftb.Mode(GridFilterMode.Menu))
.Scrollable(scrollable => scrollable.Enabled(false))
.DataSource(dataSource => dataSource
.Ajax()
.Model(model =>
{
model.Id(p => p.StaffID);
model.Field(p => p.StaffID).Editable(false);
})
.Read(read => read.Action("tblStaffExtendeds_Read", "TStaff"))
.Create(create => create.Action("tblStaffExtendeds_Create", "TStaff"))
.Update(update => update.Action("tblStaffExtendeds_Update", "TStaff"))
.Destroy(destroy => destroy.Action("tblStaffExtendeds_Destroy", "TStaff"))
)
)