I want to have the grid number column (ID field) filter to be integer. How can I accomplish that? When it run, the filter show decimal. There is no JavaScript for it. What is the correct code?
Thank you very much in advance!!
Anieda
Here is the code:
@{<br> Html.Kendo().Grid(Model)<br> .Name(
"grid"
)<br> .Columns(columns =><br> {<br> columns.Bound(request => request.Id).Encoded(
false
);<br> columns.Bound(request => request.Requestor).Encoded(
false
);<br> columns.Bound(request => request.RequestDate).Format(
"{0:MM/dd/yyyy}"
).Encoded(
false
);<br> columns.Bound(request => request.ChangeStartDateTime).Format(
"{0: M/d/yyyy h:mm tt}"
).Encoded(
false
);<br> columns.Bound(request => request.ChangeEndDateTime).Format(
"{0: M/d/yyyy h:mm tt}"
).Encoded(
false
);<br> columns.Bound(request => request.RequestSubject).Encoded(
false
);<br> columns.Bound(request => request.CurrentStatus).Encoded(
false
);<br> columns.Bound(request => request.CompletedFlag).Encoded(
false
);<br> })<br>.Filterable(filterable => filterable<br> .Extra(
false
)<br> .Operators(operators => operators<br> .ForString(str => str.Clear()<br> .Contains(
"Contains"
)<br> .StartsWith(
"Starts With "
))<br> .ForNumber(num => num.Clear()<br> .IsEqualTo(
"Equal to"
))<br> .ForDate(d => d.Clear())<br> )<br> .Mode(GridFilterMode.Row))<br>.Pageable(pageable => pageable<br> .Refresh(
true
)<br> .PageSizes(
true
)<br> .ButtonCount(5))<br>.Resizable(resize => resize.Columns(
true
))<br>.Selectable()<br>.Sortable()<br>.DataSource(dataSource => dataSource<br>.Server()<br>.Model(model => model.Id(request => request.Id))<br>)<br>.ToolBar(toolbar =><br>{<br> toolbar.Template(@<text><br> <div
class
=
"toolbar"
><br> <label
class
=
"category-label"
for
=
"category"
>Requests</label><br> @Html.ActionLink(
"New Request"
,
"New"
,
"Request"
,
null
,
new
{ @
class
=
"btn-primary btn"
})<br> </div><br></text>);<br>})<br>.Render();
Scenario: Drop-down for customer to select preferred language. If they choose anything other than English, the Radio Group 'Interpreter Required?' (Yes / No) would be a required field. If they select English, this Radio Group is NOT required.
I have the 'Required' Data Annotations set in my model:
[Required] public int? LanguageID { get; set; } [Required] public int? InterpreterRequiredID { get; set; }
View:
<div class="form-group">
<label>What is your preferred language?</label><br />
@Html.Kendo().ComboBoxFor(m => m.LanguageID).BindTo(new List<SelectListItem>()
{
new SelectListItem() { Text="English", Value="E" },
new SelectListItem() { Text="Spanish", Value="S" },
new SelectListItem() { Text="Other", Value="O" }
}).Events(e => e
.Change("LanguageID_onChange")
)
</div>
<div class="form-group">
<label>Do you require an interpreter?</label><br />
@Html.Kendo().RadioGroupFor(m => m.InterpreterRequiredID).Items(i =>
{
i.Add().Label("Yes").Value("1");
i.Add().Label("No").Value("2");
})
</div>
<script>
function LanguageID_onChange(e) {
var el = document.getElementById('InterpreterRequiredID');
if (this.value() == 'E') {
el.removeAttribute("data-val-required");
} else {
el.setAttribute("data-val-required", "This is required!");
}
}
</script>
I really have two questions: The first is as described above. I really have no need for the tool bar other than for entering cell comments, so I would like to know if there is a way to invoke that functionality with a double click. Also, I am replacing a Windows Desktop Application that does allow the users to double click to add comments so if I cannot do this in Kendo UI, it will be a behavior change for the users.
Secondly, can comment data be bound to the data source so that when I do a load or submit the database Comment field is updated along with all the other data?
Hi,
So basically I'm trying to load the items of my PanelBar at the creation of the PanelBar. My item has a LoadContentFrom itself but it only triggers once I open the panelbar item. It used to work with the LoadOnDemand property set to false but it doesn't anymore. Any idea what is I am doing wrong here?
@(Html.Kendo().PanelBar()
.Name("panelbar")
.ExpandMode(PanelBarExpandMode.Multiple)
.HtmlAttributes(new { @class = "k-primary", type = "submit", style = "width:100%" })
.LoadOnDemand(false)
.Items(panelbar =>
{
panelbar.Add().Text("Item Title").LoadContentFrom(Url.Action("Function", "Controller", Model));
}))
Thanks again!
I have a grid with a toolbar
.ToolBar( tools => { tools.Excel(); tools.Custom().Text("Finalize").IconClass("k-i-success").HtmlAttributes(new { id = "customButton", @class = "floatRight" }); } )
The icon class is k-i-success (also tried k-i-check-outline)
On this page (https://docs.telerik.com/kendo-ui/styles-and-layout/icons-web) it shows k-i-success as a checkmark in a circle.
But in my toolbar, it is a mail icon
Am I doing something wrong, or is there an error in the class name?
In some odd user-cases it is handy not to show the selected range inside the calendar when it shows up.
Case: Lets say you have a range already selected. Then you click the current start-date in the calendar which pops up. Further you click a new date back in time. This sets a new start date instead of selecting the end-date. The combination of actions requires 3 clicks to set the new range.
If the user unfortunately clicks on the start-date, it's not obvious to some people that the next date you select is still a start-date, unless you are aware that the controller does not select ranges backward in the calendar.
I am using Web API Restful Services hosting on IIS, following are my Mvc controler code, I am new to telerik and it first time.
public ActionResult Listtelerikgrid([DataSourceRequest(Prefix = "Grid")] DataSourceRequest request) {
try
{
ServiceRepository serviceObj = new ServiceRepository();
HttpResponseMessage response = serviceObj.GetResponse("/api/BreakUpValue/GetAllBreakUpValueDeals");
response.EnsureSuccessStatusCode();
IEnumerable<Models.RPS_BreakUpValue> RPSEquity = response.Content.ReadAsAsync<IEnumerable<Models.RPS_BreakUpValue>>().Result;
return Json(RPSEquity.ToDataSourceResult(request), JsonRequestBehavior.AllowGet ); //View(RPSEquity);
}
catch (Exception)
{
throw;
}
}
============================================================================================
@using Kendo.Mvc.UI
@model IEnumerable<WebRPSUIFront.Models.RPS_BreakUpValue>
<div class="row">
<div class="col-12">
@(Html.Kendo().Grid<WebRPSUIFront.Models.RPS_BreakUpValue>()
.Name("Grid")
.AutoBind(true)
.Columns(columns =>
{
columns.Bound(p => p.Sno);
columns.Bound(p => p.Symbol);
columns.Bound(p => p.BreakUpValue);
})
.Sortable()
.Pageable()
.Filterable()
.HtmlAttributes(new { style = "height:550px;" })
.DataSource(dataSource => dataSource
// .WebApi()
.Ajax()
.Model(model =>
{
model.Id(p => p.Sno);
})
.Events(events => events.Error("error_handler"))
.Read(read => read.Action("Listtelerikgrid", "BreakUpValue"))
)
)
</div>
</div>
<script type="text/javascript">
function errorHandler(e) {
if (e.errors) {
var message = "Errors:\n";
$.each(e.errors, function (key, value) {
if ('errors' in value) {
$.each(value.errors, function () {
message += this + "\n";
});
}
});
alert(message);
}
}
function error_handler(e) {
var errors = $.parseJSON(e.xhr.responseText);
if (errors) {
alert("Errors:\n" + errors.join("\n"));
}
}
</script>
I just upgraded to version 2022.1412 from 2020.3.915. I have a tooltip that loads dynamic content. It used to show a loading panel to the user while it was reaching out the server. After I upgraded it doesn't show it anymore and sometimes it seems like it's not doing anything because the load can take a few seconds. Is there anyway to get this back?
This is what it used to look like...
Thanks
Im using Kendo grid MVC and trying to determine how i can have 2 edit popup buttons (edit command at column level) that edit diffrent things. Business rules dont allow a single editor template to update all data.
example “edit address” button shows address editor tenplate and a “edit company” button which shows company editor template.
how can achieve this?