When I use a grid, I can enable Filterable and the column shows me when I am filtering it; however if I enable ColumnMenu I have no indication if I am filtering on that column. We've used a work around to handle this state ourselves, but its ugly and I think this should be part of the core product.
@(Html.Kendo().Grid<ShipmentGrid>()
.Name("grid")
.AutoBind(false)
.Columns(columns =>
{
columns.Template(@<text></text>).Width(50).Title("PDFs").ClientTemplate($"<a href='javascript:" + jsPage + $".openDocumentWindow(#=AccountId#, #=OrderNumber#, #=OrderLineId#, #=OrderLineNumber#)'><img src={Url.Content("~/Content/images/pdficon_small.png")} /></a>");
columns.Bound(m => m.CustomerName).Width(200).Title("Customer").HeaderTemplate("Customer <span style='float:center' class='k-icon k-i-filter'></span>").Filterable(f => f.Multi(true).Search(true)).Sortable(true);
columns.Bound(m => m.PurchaseOrderNumber).Width(100).Title("PO").HeaderTemplate("PO <span style='float:center' class='k-icon k-i-filter'></span>").Filterable(f => f.Multi(true).Search(true)).Sortable(true);
})
.HtmlAttributes(new { style = "font-size:0.85em;" })
.Filterable()
.ColumnMenu()
.Reorderable(reorder => reorder.Columns(true))
.Resizable(r => r.Columns(true))
.Scrollable(s => s.Height(340))
.Pageable(pageable => pageable
.Refresh(true).ButtonCount(10)
.PageSizes(new [] { 25, 250, 2500 })
)
.Sortable(sortable => sortable
.SortMode(GridSortMode.SingleColumn)
)
.ClientDetailTemplateId("itemdetail")
.DataSource(dataSource => dataSource
.Ajax()
.Read(read => read.Url("/api/shipments").Data(jsPage + ".getParameters"))
.PageSize(2500)
.ServerOperation(false)
.Events(events => events
.Error(jsPage + ".GridService.onError")
.RequestStart(jsPage + ".GridService.onRequestStart")
.RequestEnd(jsPage + ".GridService.onRequestEnd")
)
)
.NoRecords()
.Events(events => events.DataBound(jsPage + ".onDataBound"))
)
Hi Viktor,
We are looking for functionality of Context Menu on Columns of Kendo MVC grid.
We want various column selection on grid header.
Please help us to get this feature.
Regards
Supriya
Support for NullDisplayText property of the DisplayFormat metadata attribute.
JWT Token authentication has become very popular and one of the main tools to provide authorization and authentication.
JSON Web Token (JWT) is an open standard (RFC 7519) that defines a compact and self-contained way for securely transmitting information between parties as a JSON object. In authentication, when the user successfully logs in using their credentials, a JSON Web Token will be returned.
Whenever the user wants to access a protected route or resource, the user agent should send the JWT, typically in the Authorization header using the Bearer schema. This can be, in certain cases, a stateless authorization mechanism. The server's protected routes will check for a valid JWT in the Authorization
header, and if it's present, the user will be allowed to access protected resources. If the JWT contains the necessary data, the need to query the database for certain operations may be reduced, though this may not always be the case.
It would be really helpful to have a built in functionaly ".Authorization(token)" that adds an authorization header to all the requests made by the grid.
Aligning numeric values in grids is common place and best practise. Kendo Grid does not provide any neat functionality for this, especially in MVC where the model is strongly typed. Where a MVC grid is bound to a model, the Razor Wrapper would work better if it right aligned columns if for example type int (or other numeric types which are better to be right aligned). Where this needs not to be the case a data annotation would suit.
eg.
public class MyModel
{
[AlignRight(false)]
public int ProductID {get; set;}
public int Age {get; set; } // aligned right by default in Kendo Grid because of int type
}
In the above case ProductID would be left aligned, and Age would be right (which could be the default for all integer types)
With this functionality the razor implementation could also provide an align property to override align functionality. An AutoAlign property could provide this functionalityto auto detect from model or not (and also allow this functionality as being off to provide backwards compatibility)
@(Html.Kendo().Grid<MyModel>()
.Name("grid")
.AutoAlign(false)
.Columns(columns =>
{
columns.Bound(c => c.ProductID).AlignRight(false)
columns.Bound(c => c.Age).AlignRight(True)
})
add a grid to a view
open the view with data bound to the grid.
First line of data is not selected.
Now i have to program the ondatabound property for a function which belongs to the grid component. Make it configurable for grids which do not need this feature or vice versa.
It would be nice, if you can create a build-in property or function to create icon-only buttons/commands in a grid.
Actually it requires some workaround to realize this.
This Example create an edit button with the k-button-icontext class, but i want only an k-button-icon button. The destroy button gets the button name as default text.
@(Html.Kendo().Grid<WidgetDashboard.Models.Widget.WidgetData>()
.Name("adminWidgetGrid")
.Columns(columns =>
{
columns.Bound(p => p.Name).Width(150);
columns.Bound(p => p.Active).Width(75);
columns.Command(command => { command.Edit().Text(" "); command.Destroy().Text(""); }).Width(300);
})
//.ToolBar(toolbar => toolbar.Create())
.Editable(editable => editable.Mode(GridEditMode.InLine))
.Pageable(p => p.Refresh(true))
.Sortable()
.Scrollable()
.Resizable(r => r.Columns(true))
.HtmlAttributes(new { style = "height:450px; width: 100%" })
.DataSource(dataSource => dataSource
.Ajax()
.PageSize(20)
//.Events(events => events.Error("error_handler"))
.Model(model => model.Id(p => p.ID))
.Create(update => update.Action("Admin_Create", "Dashboard", new { id = Model.DashboardId }))
.Read(read => read.Action("Admin_Read", "Dashboard", new { id = Model.DashboardId }))
.Update(update => update.Action("Admin_Update", "Dashboard", new { id = Model.DashboardId }))
.Destroy(update => update.Action("Admin_Destroy", "Dashboard", new { id = Model.DashboardId }))
)
)
Alternative it would be ok if the correct css class is given when an empty string is specified.
Thank you
Christian
To whom it may concern,
I’m one of your subscribed customers. And I’m writing to seek help in order to realize a filter display I want KendoGrid to show.
The following screenshot is the date filter display that KendoGrid has:
Can it be changed to the similar way as the following picture shows?
It is also acceptable if the filter can provide 3 different options to easily choose from for users:
Thanks.
Best Regards,
BLACK STREAM
If KendoGrid can not realize the above requirements, can you please provide an alternative plan?Unless I am missing it somehow, I do not think the Grid control ( I was specifically using the MVC Grid control) does not support
1. A search feature that searches all rows and columns for the supplied text. I know you can use the filter at the top of each column to search just that column but looking for ability to search the entire dataset.
2. Ability to set the column widths as a percentage of the total space available. It looks to me like it only allows a specific px setting.
These would be good adds. If either of these are currently possible and I missed it somehow, would appreciate response regarding how to achieve this.
Thanks,
David.