ASP.NET (Page 2)

How I Export Kendo Grids to Excel (or CSV)

Exporting grid data is a common need for line-of-business applications. Once you’ve got all the great data presented, filtered, etc. how to you allow the user to download it and continue playing with it? There are many approaches discussed online to solve this (see here and here). Unfortunately, I didn’t find any of them really had the polish I wanted and that my users demand. There are really two categories of solutions to this problem:

Read more...

How to Post Data (Including Checkboxes) in a KendoUI Grid back to an ASP.NET MVC Action

The KendoUI grid is great for displaying data and manipulating it one row at a time. There are several options available including posting the edited data back via AJAX, performing in-line editing, etc. However, there is no built-in support for posting the grid data on form submission because the grid isn't an actual form control. This came up recently when designing a feature for an enterprise contact list. I had a view that should allow the user to select two contacts and merge them into one. The user needed to be able to select which addresses, phone numbers, etc. from both contact should be kept in the merged contact. A grid seemed like a perfect interface match since it supports multiple columns and I could (presumably) add a checkbox to the first (or last) one for the user to select. This turned out to be much more complicated than I had anticipated and there isn't a lot of help out there, so I'll walk you through the process.

Read more...

Strongly Typed Icon Fonts in ASP.NET MVC

This a technique for working with icon fonts, which have been steadily gaining in popularity. I love icon fonts. They allow me to package up a whole bunch of simple glyphs and pictograms, use them on my site or application without too much fuss on nearly every browser, and let me control presentation attributes such as color, size, etc. I especially like the recent trend of web-based tools for building custom icon fonts from an available library of glyphs (I tend to use Fontastic, but I've also had good luck with IcoMoon and FlatIcon).

Read more...

Automatically Generating Column Titles For A KendoUI MVC Grid

I love KendoUI, especially because of the available MVC wrappers. It is a very well engineered product with lots of opportunity for extension, and in this post I'll briefly discuss one that should relieve a small pain point: generating grid column titles from a DisplayAttribute data annotation. As you probably already know, you can change the way your UI layer presents properties of your model by applying the DisplayAttribute data annotation. This causes most of the UI code to use the Name property of the attribute when displaying that property. It looks like this:

Read more...

Getting an HtmlHelper for an Alternate Model Type

First off, I'm back and have a lot of little tips to blog about over the next several weeks. Since my last post I have changed jobs and am no longer working with Mono, Gtk#, or XML on a daily basis. However, I am still developing for the .NET platform and have been focusing recently on ASP.NET MVC and Entity Framework. Now, on to the topic at hand...

Read more...

open source (18) ASP.NET (15) ASP.NET MVC (14) static site generator (9) programming (8) Azure (7) Wyam (7) Roslyn (7) NuGet (6) devops (5) .NET Compiler Platform (5) Razor (4) personal (4) Vue.js (4) Entity Framework (4) LINQ (4) database (4) KendoUI (4) KendoUI MVC (4) grid (4) csharp (3) scripting (3) meta (3) T4 (3) XML (3) Mono (3) GtkSharp (3) tools (2) Cake (2) msbuild (2) magic strings (2) Azure Cosmos DB (2) Azure Functions (2) LINQ to Entities (2) strings (2) algorithms (2) LINQPad (2) blog (2) CSS (2) export (2) CSV (2) HtmlHelper (2) Entity Framework Code First (2) Nxdb (2) XQuery (2) Blazor (1) WebAssembly (1) Netlify (1) FTP (1) documentation (1) configuration (1) DSL (1) enum (1) stdin (1) stream (1) console (1) cli (1) npm (1) node (1) microdependencies (1) collections (1) concurrent (1) HashSet (1) Twitter (1) Serilog (1) MiniProfiler (1) logging (1) OWIN (1) templating (1) design (1) web (1) JavaScript (1) API (1) IIS (1) debugging (1) LINQ to SQL (1) FluentBootstrap (1) Bootstrap (1) RazorDatabase (1) GitHub (1) AppVeyor (1) fluent interfaces (1) method chaining (1) style (1) conventions (1) PDF (1) Acrobat (1) Excel (1) checkbox (1) postback (1) icon fonts (1) icons (1) SQL (1) SQL Server (1) round robin (1) DotNet (1) Dictionary (1) MultiDictionary (1) data annotations (1) persistence (1) object persistence (1) NiceThreads (1) Threading (1) Monitor (1) ReaderWriterLockSlim (1) locking (1) ILocker (1) networkdays (1) weekdays (1) ButtonPressEvent (1) Context Menu (1) ContextMenuHelper (1) Menu (1) Popup (1) Popup Menu (1) CellRenderer (1) TreeModel (1) TreeView (1) TreeViewColumn (1)