Here's what I'm doing:
// client side:
//I get a grid datasource filter
var fs = grid.dataSource.Filter()
// I then stringify it and pass it over to the server via an ajax call
// server side, I get the full filter string
// now i do this:
DataSourceRequest dsr = new DataSourceRequest();
Question: How do I take that filter string and recreate the full datasource Filters ?
p.s. I have to do it this way - I cannot have a DataSourceRequest in the endpoint parameters passed in.
I'm sharing a datasource between a grid and listview. Everything works great - except when the user groups in the grid - the listview is unable to deal with a datasource having groups. Sorting and filtering works great.
Would it be possible in the future to consider adding grouping to listviews where the listview code would use the same datasource functionality as found in the grid grouping functionality?
Thanks,
Rene.
Hi all,
I've seen all of the 4 episodes of the Getting Started with the Kendo UI for ASP.Net MVC, however I can't seem to figure out how to set up a DataSource with a Generic ObjectList.
This is the piece of code I currently have:
public
JsonResult Get([DataSourceRequest] DataSourceRequest request)
{
Runner runner =
new
Runner();
Task<List<CustomOrder>> customOrderResult = Task.Run(async () => await runner.GetCustomOrders().ConfigureAwait(
false
));
Task.WhenAll(customOrderResult);
List<CustomOrder> customOrders = customOrderResult.Result;
}
I know it ain't perfect. Going to refactor it as soon as I got it working properly.
Thanks in advance for all your help.
Hello All,
i have attach a file to this thread which is based on the VSflexgrid control in asp technology.
the same functionality i want to achieve using telerik treelist control with asp.net mvc.
In the attach file there are two horizontal parts.
the above part display the treeview in left side and the associated grid that to with editable cell like excel into it towards the right side.
if we write anything on the grid cell say a number i type there the below part where there are also a grid with dynamic row and column description
gets added the value into it.
Kindly let me know if this functionality is achievable .
Please go through the attach file screenshot and kindly let me know.
Hello,
I am wondering why the highlightings (k-header-column-menu k-state-active) of filtered columns are not automatically restored by the framework after the settings have been loaded.
The settings are stored and loaded using setOptions and getOptions. But if you do so, the k-state-active class is not set to columns with active filters.
Is this missing behavior a known bug or "as designed"? And how can it be solved?
Thanks in advance,
Holger
I hate bringing this up, because DST can be such a mind #$%$. But here we go:
I have declared a Kendo datetimepicker like so:
@(Html.Kendo().DateTimePicker()
.Name("StartDatePicker")
.Format("yyyy/MM/dd HH:mm zzz")
.TimeFormat("HH:mm")
)
I'll be using MST as my example timezone, ie. -6:00 or -7:00. On November 1st @ 2:00 AM time goes backwards 1 hour. So basically the time one second after 1:59:59 AM (-06:00) becomes 1:00:00 AM (-07:00)
The KendoDateTimePicker seems to be smart enough to recognize the timezone change. For example, selecting November 1st 00:30 (pre-time change) will show a timezone of (-06:00), and selecting November 1st 02:00 (post time change) will show a timezone of (-07:00)
The tricky part with the November time change is that there are two occurrences of 01:00:00 - 01:59:59 during that day. The first occurrence has a timezone of -06:00 and the second has a timezone one less, of -07:00. So the question is, how do I select one occurrence or the other, without having to manually input the timezone?
The expectation is that the clients current timezone is used. So if the current local time is before the time change (-06:00), then if I select November 1st 01:30 I expect the timezone to be (-06:00). If the current local time is after the time change (-07:00), then if I select November 1st 01:30 I expect the timezone to be (-07:00).
At the moment the KendoDateTimePicker doesn't match those expectations, and instead defaults to the pre-time change timezone of (-06:00) regardless of what the timezone of the web server or the client is. It is therefore impossible to select time between 01:00:00 - 01:59:59 (-07:00).
Is this a bug or is there someway of making the datetimepicker aware of the client's current timezone?
I have a search form which will get a list of records.
I would like to bind the search results on pressing submit after performing some initial checks on the entered data. How do i bind my action result to the Kendo Grid ?
My JS File is
function validateDataForSearch() {
var empNo = $("#empNo").val();
var empName = $("#empName").val();
var empMgr = $("#empMgr").val();
var clientName = $("#ClientName").val();
var noValues = empNo.length + empName.length + empMgr.length + clientName.length;
if (noValues <= 0) {
alert("Please enter at least one value to be able to search.");
}
else {
if (empNo.length <= 0)
empNo = 0;
$.ajax({
type: "POST",
url: 'Home/Search',
data: { empNo: empNo, empName: empName, empMgr: empMgr, clientName: clientName },
success: function (response) {
$("#pmtSearchResult").getKendoGrid().dataSource.data(response);
}
});
};
function getEmpLink(project) {
var action = '@Url.Action("Index","PMP", new { emp= '+ emp +')';
var empLink = kendo.format("<a href='{0}'>{2}</a>", action, emp.empNo);
return empLink;
}
var validator = $("#searchForm").kendoValidator().data("kendoValidator");
$("#btnSearch").click(function (e) {
if (!validator.validate()) {
e.preventDefault();
}
else
validateDataForSearch();
});
My CSHTML is as follows
@model IEnumerable<PMT.Models.EmpData>
<div id="kendoGrid">
@(Html.Kendo().Grid(Model)
.Name("SearchResult")
.Columns(columns =>
{
columns.Bound(p => p.empNo).ClientTemplate("#= getEmpLink(data) #");
columns.Bound(p => p.empName);
columns.Bound(p => p.empMgr);
columns.Bound(p => p.ClientName);
columns.Bound(p => p.empSal).hidden(true);
})
.Pageable()
.Sortable()
.Scrollable(scr => scr.Height(430))
.Filterable()
.DataSource(dataSource => dataSource
.Ajax()
.PageSize(20)
.ServerOperation(false)
)
)
I cant seem to render the grid to hide the empSal column or to show the emloyeeid column as a hyperlink column
Please find the below code as i want to set default value of dropdown instead of optionlable from JSON data which is returned from controller .
Please find the below code
@(Html.Kendo().DropDownList()
.Name("DropDownList1")
.HtmlAttributes(new { style = "width:300px" })
.OptionLabel("Select ...")
.DataTextField("District_Id")
.DataValueField("Location_ID")
.DataSource(source =>
{
source.Read(read =>
{
read.Action("GetOrders", "IDTDashboard");
})
.ServerFiltering(true);
})
.AutoBind(false)
public ActionResult GetOrders()
{
List<usp_IDQ_GetLicenseDistrictsVO> objresult1 = new List<usp_IDQ_GetLicenseDistrictsVO>();
objresult1 = objConnection.usp_IDQ_GetLicenseDistricts(User.Identity.Name, true).ToList();
return Json(objresult1, JsonRequestBehavior.AllowGet); ;
}
Hi,
We have a combobox and a button inside a form (all HTML helper) and when we submit (its just a search form) two querystring items are appended to the forms destination - one with the name of the "Combobox" giving the value and one with "ComboBox_input" giving the text.
We're using a combobox so we can have the Text and the Value separate.
How can we stop both the Text AND Value being added as a querystring value?
I know we can do an on change event and window.location, but we've a requirement for an actual button to click and I thought this would work ...
01.
@
using
(Html.BeginForm(
"Details"
,
"Property"
, FormMethod.Get))
02.
{
03.
04.
@(Html.Kendo().ComboBox()
05.
.Name(
"PropertyId"
)
06.
.DataTextField(
"Searchable"
)
07.
.DataValueField(
"PropertyRef"
)
08.
.Placeholder(
"Search for property by ref or name ..."
)
09.
.Filter(FilterType.Contains)
10.
.AutoBind(
false
)
11.
.MinLength(4)
12.
.DataSource(source =>
13.
{
14.
source.Read(read =>
15.
{
16.
read.Action(
"PropertySearch_Read"
,
"Search"
);
17.
})
18.
.ServerFiltering(
false
);
19.
})
20.
.HtmlAttributes(
new
{ style =
"width:100%"
})
21.
)
22.
23.
24.
@(Html.Kendo().Button()
25.
.Name(
"btnSubmit"
)
26.
.HtmlAttributes(
new
{ type =
"submit"
})
27.
.Content(
"Search"
)
28.
)
29.
}
Thanks,
Daniel