Skip to content

Instantly share code, notes, and snippets.

@Warr1611
Warr1611 / kendoGridColumnOverflowFix.cshtml
Last active November 2, 2017 15:13
[Kendo Grid column overflow fix] Fix a kendo grid overflowing to the right when too many columns. #kendo #csharp #grid
<div style="width=100%;">
@(Html.Kendo().Grid()
.Scrollable()
)
</div>
@Warr1611
Warr1611 / ConvertDateTimeToTimeZone.cs
Created June 29, 2017 18:51
[Convert DateTime to TimeZone] Convert a DateTime to a TimeZone given the timeZoneIdentifier. #datetime #timezone #csharp
var timeZoneIdentifier = GetTimeZoneIdentifier(); // Get the appropriate timezoneidentifier from somewhere
var now = TimeZoneInfo.ConvertTimeBySystemTimeZoneId(DateTime.Now, timeZoneIdentifier);
@Warr1611
Warr1611 / KendoGrid.cshtml
Created June 28, 2017 14:37
[Kendo Grid] Kendo grid using MVC helpers. #kendo #grid
@{
bool viewCreateUserName = false;
}
@helper ToolbarTemplate()
{
<button class="k-button k-button-icontext k-grid-excel"><span class="k-icon k-i-excel"></span>Export to Excel</button>
<button class="k-button k-button-icontext selectall"><span class="k-icon"></span>Select All</button>
@*<a class="k-button k-button-icontext savegridstate" href="#"><span></span>Save Grid State</a>
<a class="k-button k-button-icontext loadgridstate" href="#"><span></span>Load Grid State</a>
@Warr1611
Warr1611 / KendoGridSettings.cshtml
Created June 27, 2017 20:55
[Kendo Grid Settings] Kendo grid settings for sort, filter, resize, reorder, group, column menu. #kendo #grid
.Sortable()
.Filterable()
.Resizable(r => r.Columns(true))
.Reorderable(r => r.Columns(true))
.Groupable()
.ColumnMenu() // This gives the drop down menu on columns.
// In order to get the Multi-select list on a column menu, that specific column has to be setup with Multi(true), like this:
// columns.Bound(c => c.ColumnName).Filterable(f => f.Multi(true));