Hi,
Im am working on a grid with some Integer data columns in it (like customer Id), including filtering in the top row of the grid (thus with.Filterable(ftb => ftb.Mode(GridFilterMode.Row)); )
By default, I see decimals in the filter textbox, like 16.00.
How can I remove those decimals (just plain int) ? So that I see just 16 instead of 16.00.
I tried a lot. Like setting format to "#", "N0", "n0", "0:N0", "0:n0", etc. Also a suggestion about a javascript function coupled. But nothing seems to work.
My code is now something like this:
columns.Bound(colInfo.Name)
.Title(colInfo.Title)
.Width(colInfo.PixelWidth)
.Format(colInfo.DataFormat)
;
best regards,
Martin
Hi,
How can I get a vertical scrollbar in the Form component ?
I mean, the form area excl. the buttons.
I'd prefer to achieve this without having to add a css style on the page, but instead achieve this with a simple piece of (serverside) code.
In html/css I can see the following structure
- html form
- div formlayout
- fieldset
- fieldset
I would like to have a vertical scrollbar on the div formlayout I guess. Buttons shouldnt scroll, but stay visible.
In my scenario I have only 1 column of fields, but should work for any amount of columns in layout.
Martin
Hi
I'm searching example to save data from Kendo grid in mode batch and Edit in GridEditMode.InCell
I need call a Controler MVC send data grid with other data for example textarea without grid and other information.
I only find examples save with grid events.
Thanks
Rose
Hi.
I need display content in a ClientTemplate with contain two DropDownList and one input.
columns.Bound(m => m.ComposicioMix).ClientTemplate("#= prueba(ComposicioMix)#").EditorTemplateName("ComposicioMix").Width(300).Title("Composició/Mix");
In EditorTemplateName i've build the next Template ComposicioMix and this model
public class ComposicioMix_VM
{
//datos de 2 desplegables y numerico del porcentaje
public PaisosListItem PaisMix { get; set; }
public AgenteListItem AgenteMix { get; set; }
public int Porcentaje { get; set; }
}
public class PaisosListItem
{
public int OBJECTID { get; set; }
public string Nom { get; set; }
}
public class AgenteListItem
{
public int OBJECTID { get; set; }
public string DESCRIPCIO { get; set; }
}
@model DGMAS.Data.ViewModels.FluxosREN.ComposicioMix_VM
<table>
<tr>
<td>
<label>Pais/Agent</label>
</td>
<td>
@(Html.Kendo().DropDownListFor(m => m.PaisMix.OBJECTID)
.Name("PAIS1")
.DataValueField("OBJECTID")
.DataTextField("Nom")
.BindTo((System.Collections.IEnumerable)ViewData["PAIS"])
)
</td>
<td>
@(Html.Kendo().DropDownListFor(m => m.AgenteMix.OBJECTID)
.Name("AGENTE1")
.DataValueField("OBJECTID")
.DataTextField("DESCRIPCIO")
.BindTo((System.Collections.IEnumerable)ViewData["AGENTE"])
)
</td>
<td>
<input id="porcentaje1" type="text" size="2" />
<span>%</span>
</td>
</tr>
<tr></tr>
</table>
I have a problem with ClientTemplate I can't display it
<script id="responsive-column-template-ComposicioMix" type="text/x-kendo-template">
<div class="responsiveGridCssAnchor">
<div class="titleRowMobile">Pais/Agent</div>
<p class="col-template-val textMobileCell">#= data.PaisMix.Nom #</p>
<p class="col-template-val textMobileCell">#= data.AgenteMix.DESCRIPCIO #</p>
<p class="col-template-val textMobileCell">#= data.Porcentaje #</p>
</div>
</script>
var prueba = kendo.template($("#responsive-column-template-ComposicioMix").html());
I need help to get contain to display in kendo-template
Regards,
Rose
Hi,
How can I get a textbox in the form fields with 0 decimals ?
There are always 2 decimals now.
Is teher a simple way to do it ? Preferably serverside.
Martin
I was able to make the dropdownlist work in a plain asp.net mvc project. But when I attached the same code in Sharepoint Provider-Hosted Add-in, it only displays as a blank text box. Do I need to add anything? I attached the plain asp.net mvc project and screenshots.
Thanks!
When one file is dragged and dropped onto the control the Upload endpoint is called twice.
My control is declared as follows:
@(Html.Kendo().FileManager().Name("documentExplorer")
.DataSource(ds =>
{
ds.Read(operation => operation
.Type(HttpVerbs.Post)
.Action("Read", "DocumentExplorer", new { groupId = ViewBag.GroupId }));
ds.Destroy(operation => operation
.Type(HttpVerbs.Post)
.Action("Delete", "DocumentExplorer", new { groupId = ViewBag.GroupId }));
ds.Create(operation => operation
.Type(HttpVerbs.Post)
.Action("Create", "DocumentExplorer", new { groupId = ViewBag.GroupId }));
ds.Update(operation => operation
.Type(HttpVerbs.Post)
.Action("Update", "DocumentExplorer", new { groupId = ViewBag.GroupId }));
})
.InitialView("grid")
.UploadUrl("Upload", "DocumentExplorer", new { groupId = ViewBag.GroupId })
.Draggable(true)
.Toolbar(tb => tb.Items(items =>
{
items.Add().Type("button").Text("").Command("NavigateToRoot").HtmlAttributes(new { title = "Go to Root" }).Icon("home");
}))
.Events(e => {
e.Open("downloadFile");
e.Execute("onExecute");
e.Navigate("onNavigate");
e.DataBinding("onDataBinding");
e.DataBound("onDataBound");
e.Drop("onDrop");
})
)
I'm using the events mostly for troubleshooting this issue, so they just output the received event/data. That being said, the onDrop is not being called. Any help with figuring out why this happens will be greatly appreciated.
Thanks,
-Carlos
can someone help please
my platform is asp.net mvc 5 using razor pages in vs 2019 using telerik latest controls.
in my patient page I have a kendo listivew inside of a kendo TileLayout.
datasource is a list of patient name populating the listivew
listView generate the listing of items just fine.
however, when I select on the listivew i can not get the current selected item number,
which will generate an action
no index number, no way to find where to get the selected item.
What Am I Doing Wrong.
// index.cshtml
@model ap_GetMembershipListAllRow
<script type="text/x-kendo-template" id="template">
<div class="patient-view k-widget">
<div class="patientidtemp">#:Patient_ID#</div>
<div class="fullnametemp">#:LastName#, #:FirstName# #:MiddleName#</h1>
<div class="bdatetemp">Date Begin: #:kendo.toString(BeginDate,"MMM/dd/yyyy")#</div>
</div>
</script>
<script type="text/x-kendo-template" id="template2">
<div class="patient-view k-widget">
<div class="patientidtemp1">#:Patient_ID#</div>
<div class="fullnametemp1">#:LastName#, #:FirstName# #:MiddleName#</h1>
<div class="bdatetemp1">Date Begin: #:kendo.toString(BeginDate,"MMM/dd/yyyy")#</div>
</div>
</script>
<script type="text/x-kendo-template" id="patient-list">
@(Html.Kendo().ListView<ListViewModel>()
.Name("PatientListView")
.TagName("div")
.ClientTemplateId("template")
.ClientAltTemplateId("template2")
.DataSource(dSource => dSource
.Ajax()
.Read(read => read.Action("PatientList_Read", "PatientPortal").Type(HttpVerbs.Get))
.PageSize(11)
.Model(model => model.Id("Patient_ID"))
)
.Pageable()
.Selectable(selectable => selectable.Mode(ListViewSelectionMode.Single))
.Events(events => events.Change("onChange"))
.ToClientTemplate()
)
</script>
//patientportal.js
// nothing works
function onChange(e) {
var ds = $("#PatientListView").data("kendoListView");
var index = ds.select().index(),
dataItem = ds.dataSource.view()[index];
var item = dataItem;
var listViewx = $("#PatientListView").data("kendoListView");
selectItem = listViewx.dataSource.index();
listView.select(listView.content.children().first());
var dataSource = listViewx.dataSource.view();
if (listViewx) {
$.each(dataSource, function (index, item) {
if (item.Code === code) {
listViewx.select(item);
selectedCoverageCode = item;
}
});
}
var index = this.select().index();
dataItem = this.dataSource.view()[index];
}
// controller.cs
public JsonResult PatientList_Read([DataSourceRequest] DataSourceRequest request)
{
var result = patientService.GetMembersListItem(); //default list
if (ViewData["PatientID"] != null && ViewData["MultiNames"] as string == "Individual")
{
string first = ViewData["FirstName"] as string;
string last = ViewData["LastName"] as string;
result = patientService.GetPatientSearchNames(last,first );
}
return new JsonResult(result.ToDataSourceResult(request));
}
// patientPortalService.cs
public List<ListViewModel> GetMembersListItem()
{
string connectionString = _configuration.GetConnectionString("ManagerToolsDBContextConnection");
ap_GetMembershipListAll listAll = new ap_GetMembershipListAll(connectionString);
listAll.Clinic_id = Convert.ToInt32(_session.GetString("ClinicNumber"));
Collection<ap_GetMembershipListAllRow> row = listAll.Execute();
return GetPatientListViewMapping(row);
}
public List<ListViewModel> GetPatientListViewMapping(Collection<ap_GetMembershipListAllNameRow> ap_Get)
{
List<ListViewModel> lv = new List<ListViewModel>();
foreach (ap_GetMembershipListAllNameRow item in ap_Get)
{
ListViewModel nlv = new ListViewModel();
nlv.FirstName = item.FirstName.ToString();
nlv.MiddleName = item.MiddleName.ToString();
nlv.LastName = item.LastName.ToString();
nlv.Patient_ID = (long)item.Patient_id;
nlv.BeginDate = (DateTime)item.MembershipStartDate;
lv.Add(nlv);
}
return lv;
}
//ListViewModel.cs
public class ListViewModel
{
public long Patient_ID { get; set; }
public string Greeting { get; set; }
public string FirstName { get; set; }
[DefaultValue(true)]
public string MiddleName { get; set; }
public string LastName { get; set; }
[DisplayFormat(DataFormatString = "{0:dd-MMM-yyyy}")]
public DateTime BeginDate { get; set; }
}