Skip to content

Instantly share code, notes, and snippets.

@shamp00
shamp00 / MVCGridExtension_notes.md
Last active September 1, 2016 10:58
Notes on MVC GridExtension in server mode

Server mode EF binding example

@Html.DevExpress().GridView(settings => {
    settings.Name = "grid";

    settings.CallbackRouteValues = new { Controller = "EFDatabaseServerMode", Action = "GridViewPartial" };

    settings.KeyFieldName = "OrderID";
<?xml version="1.0" encoding="utf-8"?>
<XtraReportsLayoutSerializer SerializerVersion="15.2.3.0" Ref="1" Name="XtraReport" ControlType="DevExpress.XtraReports.UI.XtraReport, DevExpress.XtraReports.v15.2, Version=15.2.3.0, Culture=neutral, PublicKeyToken=b88d1754d700e49a" DataSource="#Ref-0" DisplayName="Contacts Report" ScriptsSource="&#xD;&#xA;private void xrTableCell8_BeforePrint(object sender, System.Drawing.Printing.PrintEventArgs e) {&#xD;&#xA; var x = 23;&#xD;&#xA;}&#xD;&#xA;" Version="15.2" PageWidth="850" PageHeight="1100">
<Extensions>
<Item1 Ref="2" Key="DataSerializationExtension" Value="XtraReport" />
<Item2 Ref="3" Key="DataEditorExtension" Value="XtraReport" />
<Item3 Ref="4" Key="ParameterEditorExtension" Value="XtraReport" />
</Extensions>
<Bands>
<Item1 Ref="5" ControlType="DetailBand" Name="Detail" TextAlignment="TopLeft" Padding="0,0,0,0,100" HeightF="23">
<Controls>
@shamp00
shamp00 / ContactsReport.repx
Last active December 9, 2015 13:04
Comparison of XAF 15.2 report layout serialization
/// <XRTypeInfo>
/// <AssemblyFullName>DevExpress.XtraReports.v15.2, Version=15.2.3.0, Culture=neutral, PublicKeyToken=b88d1754d700e49a</AssemblyFullName>
/// <AssemblyLocation>C:\Windows\Microsoft.Net\assembly\GAC_MSIL\DevExpress.XtraReports.v15.2\v4.0_15.2.3.0__b88d1754d700e49a\DevExpress.XtraReports.v15.2.dll</AssemblyLocation>
/// <TypeName>DevExpress.XtraReports.UI.XtraReport</TypeName>
/// <Localization />
/// <Version>15.2</Version>
/// <References>
/// <Reference Path="C:\Windows\Microsoft.Net\assembly\GAC_MSIL\DevExpress.Persistent.Base.v15.2\v4.0_15.2.3.0__b88d1754d700e49a\DevExpress.Persistent.Base.v15.2.dll" />
/// <Reference Path="C:\Windows\Microsoft.Net\assembly\GAC_MSIL\System\v4.0_4.0.0.0__b77a5c561934e089\System.dll" />
/// <Reference Path="C:\Windows\Microsoft.Net\assembly\GAC_MSIL\System.Configuration\v4.0_4.0.0.0__b03f5f7f11d50a3a\System.Configuration.dll" />
Public NotInheritable Partial Class MoreEnumerable
Private Sub New()
End Sub
<System.Runtime.CompilerServices.Extension> _
Public Shared Function Batch(Of TSource)(source As IEnumerable(Of TSource), size As Integer) As IEnumerable(Of IEnumerable(Of TSource))
Return Batch(source, size, Function(x) x)
End Function
<System.Runtime.CompilerServices.Extension> _
# Boxstarter script for blog post http://blog.zerosharp.com/provisioning-a-new-development-machine-with-boxstarter
# Allow reboots
$Boxstarter.RebootOk=$true
$Boxstarter.NoPassword=$false
$Boxstarter.AutoLogin=$true
# Basic setup
Update-ExecutionPolicy Unrestricted
Set-ExplorerOptions -showHidenFilesFoldersDrives -showProtectedOSFiles -showFileExtensions
@shamp00
shamp00 / Reflector.cfg
Last active December 30, 2015 00:19
Config file for .NET Reflector including assembly lists for several versions of DevExpress XAF.
; ==========================================================
; Config file for .NET Reflector including assembly lists
; for several versions of DevExpress XAF.
;
; Copy this file to:
; %LocalAppData%\Red Gate\.NET Reflector 8\Reflector.cfg
; ==========================================================
[AssemblyBrowser]
AssemblyList="DevExpress 13.2"
@shamp00
shamp00 / gist:7272527
Created November 1, 2013 21:51
StackOverflow caching routine from Marco Cecconi's presentation (https://www.youtube.com/watch?v=t6kM2EM6so4)
private static List<HelpPost> All()
{
return Current
.GlobalCache
.GetSet<List<HelpPost>>(
CacheKey,
(old, ctx) =>
{
using (SiteDBContext siteDb = SiteDBContext.NewContext())
{
using System;
using System.Linq;
using DevExpress.Xpo;
using DevExpress.Xpo.DB;
namespace XpoConsoleApplication1
{
class Program
{
public class Photo : XPObject
@shamp00
shamp00 / MainDemo_CycleThroughTabs.js
Created April 3, 2013 15:26
Sample Selenium script for load testing the XAF MainDemo. See http://blog.zerosharp.com/load-testing-xaf-part-2-selenium/ for more information.
// MainDemo_CycleThroughTabs.js
/*global test */
// Settings for Neustar:
// replace the following with the public address of the application server,
var targetHost = "http://zerosharp-maindemo.elasticbeanstalk.com/";
var virtualShare = "MainDemo.Web_deploy";
// Settings for debug webserver:
@shamp00
shamp00 / BootCampControlPanel.cmd
Created October 9, 2012 16:42
Access the BootCamp ControlPanel from Windows 8. Run as Administrator.
@echo off
runas /trustlevel:0x20000 "C:\Windows\System32\AppleControlPanel"
if %ERRORLEVEL% neq 0 goto error
goto OK
:ERROR
echo.
echo Are you sure you are running from a shortcut as Administrator?
pause