Posts

Showing posts from April, 2017

Strength of Canvas in WPF

- Allow to display 3D by ZIndex property. - Easy to place elements by Canvas.Top, Bottom, Left, and Right properties. - Support to draw shape like Eclipse, Rectangle.

C#: TimeSpan ToString Format

myTimeSpan . ToString ( "d'day 'h'hour 'm'min 's'sec'" );

Razor: Convert Dictionary from Server to Javascript Dictionary

@model  IEnumerable <HD.TVAD.Features.TimePeriod.SponsorProgram.Models. SponsorProgramViewModel > @{      Dictionary < string ,  Guid > dicProgram =  new   Dictionary < string ,  Guid >();      foreach  ( var  temp  in  Model)     {         dicProgram.Add(temp.Name, ( Guid )temp.Id);     } } <script> var  sponsorProgramDic = {};     sponsorProgramDic =  @ Json.Serialize(dicProgram); </script>

Reloading/refreshing Kendo Grid

$('#GridName').data('kendoGrid').dataSource.read(); $('#GridName').data('kendoGrid').refresh();

KendoUI grid edit popup, how to hide field

To hide a filed simply add this to the view model: [ScaffoldColumn(false)]  

Javascript: Get ID of clicked-item

<!DOCTYPE html> <head> <title> It works </title> </head> <body> <div id = "div1" ></div> <div id = "div2" ></div> <script type = "text/javascript" > document . addEventListener ( 'click' , function ( e ) { alert ( e . target . id ); }, false ); </script> </body> </html>

Kendo Grid - Get ID of right-clicked item

Image