Skip to content

Instantly share code, notes, and snippets.

shamp00 /
Last active Sep 1, 2016
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";
View ContactReport.xml
<?xml version="1.0" encoding="utf-8"?>
<XtraReportsLayoutSerializer SerializerVersion="" Ref="1" Name="XtraReport" ControlType="DevExpress.XtraReports.UI.XtraReport, DevExpress.XtraReports.v15.2, Version=, 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">
<Item1 Ref="2" Key="DataSerializationExtension" Value="XtraReport" />
<Item2 Ref="3" Key="DataEditorExtension" Value="XtraReport" />
<Item3 Ref="4" Key="ParameterEditorExtension" Value="XtraReport" />
<Item1 Ref="5" ControlType="DetailBand" Name="Detail" TextAlignment="TopLeft" Padding="0,0,0,0,100" HeightF="23">
shamp00 / ContactsReport.repx
Last active Dec 9, 2015
Comparison of XAF 15.2 report layout serialization
View ContactsReport.repx
/// <XRTypeInfo>
/// <AssemblyFullName>DevExpress.XtraReports.v15.2, Version=, 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" />
View gist:8541fdc394ccc23ee6c9
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> _
View Boxstarter.Blog.ps1
# Boxstarter script for blog post
# Allow reboots
# Basic setup
Update-ExecutionPolicy Unrestricted
Set-ExplorerOptions -showHidenFilesFoldersDrives -showProtectedOSFiles -showFileExtensions
shamp00 / Reflector.cfg
Last active Dec 30, 2015
Config file for .NET Reflector including assembly lists for several versions of DevExpress XAF.
View Reflector.cfg
; ==========================================================
; 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
; ==========================================================
AssemblyList="DevExpress 13.2"
shamp00 / gist:7272527
Created Nov 1, 2013
StackOverflow caching routine from Marco Cecconi's presentation (
View gist:7272527
private static List<HelpPost> All()
return Current
(old, ctx) =>
using (SiteDBContext siteDb = SiteDBContext.NewContext())
View Program.cs
using System;
using System.Linq;
using DevExpress.Xpo;
using DevExpress.Xpo.DB;
namespace XpoConsoleApplication1
class Program
public class Photo : XPObject
shamp00 / MainDemo_CycleThroughTabs.js
Created Apr 3, 2013
Sample Selenium script for load testing the XAF MainDemo. See for more information.
View MainDemo_CycleThroughTabs.js
// MainDemo_CycleThroughTabs.js
/*global test */
// Settings for Neustar:
// replace the following with the public address of the application server,
var targetHost = "";
var virtualShare = "MainDemo.Web_deploy";
// Settings for debug webserver:
shamp00 / BootCampControlPanel.cmd
Created Oct 9, 2012
Access the BootCamp ControlPanel from Windows 8. Run as Administrator.
View BootCampControlPanel.cmd
@echo off
runas /trustlevel:0x20000 "C:\Windows\System32\AppleControlPanel"
if %ERRORLEVEL% neq 0 goto error
goto OK
echo Are you sure you are running from a shortcut as Administrator?