Thursday 28 February 2013

Telerik GridViewCheckBoxColumn

There are two major bugs with checkboxes within grids.

The first is that the control doesn't act normally once it's within the grid. 

For example to change its value takes three clicks before the UI changes from unselected to selected:    

  1. the first click selects/sets focus to the grid 
  2. the second click selects/sets focus to the grid 
  3. the third click finally updates the value

This is solved by setting the AutoSelectOnEdit=”True” and EditTriggers=”CellClick”.

Now you hit the second issue, the model still doesn’t update.

To solve this you need to split out the column to use a CellTemplate and DataTemplate containing a CheckBox control with the IsChecked property bound using UpdateSourceTrigger=PropertyChanged.

Example

This example binds to an "IsDefault" property.

What you would expect to work

<telerik:GridViewCheckBoxColumn DataMemberBinding="{Binding IsActive, Mode=TwoWay}" />


What actually works
<telerik:GridViewCheckBoxColumn AutoSelectOnEdit="True"
EditTriggers="CellClick"
DataMemberBinding="{Binding IsActive, Mode=TwoWay, UpdateSourceTrigger=PropertyChanged }" />

Wednesday 27 February 2013

Publishing a Windows Phone app

1. Create your app and store the code on GitHub (mine is open source so github and phonegap are free)

2. Use http://build.phonegap.com to generate the xap file, no keys are required.  Download the xap file.

3. Register as a developer with Microsoft around $99 fill out the registration some tax information and your app details:

https://dev.windowsphone.com

4. Wait up to 5 business days…

image

Publishing an Android app to Google Play

Using PhoneGap to build my Android package from GitHub here are the steps to publish to Google Play.

1. Store your app source code in github (mine is open source so github and phonegap build services are free).

2. Install the latest jdk on your computer:  http://www.oracle.com/technetwork/java/javase/downloads/index.html

3. Create a key using the keytool, by opening a command prompt:
cd "C:\Program Files\Java\jdk1.7.0_15\bin"
keytool -genkey -v -keystore itineraryhuntermobile-key.keystore -alias itineraryhuntermobile -keyalg RSA -keysize 2048 -validity 10000

(replacing itineraryhuntermobile with the name of your application)

keytool-1

3. Add your key to phonegap build cloud services:

edit-account

5. Use http://build.phonegap.com to rebuild and download the APK file

Once you’ve assigned your key to the Android section, entered your password which phonegap store for one hour, you can rebuild a release version of your apk file.

build-download

6. Register with Google Play, pay the $25 developer fee and fill out the application details including application screenshots:

https://play.google.com/apps/publish

google-play

7. Wake up the next morning and your app will be in the Google Play store:

 

google-playapp-store

You can find it in Google Play here:  https://play.google.com/store/apps/details?id=itinerary.hunter.mobile

Tuesday 26 February 2013

Itinerary Hunter goes mobile!

I’ve open sourced my Itinerary Hunter mobile app.

It’s written in HTML, JavaScript and jQuery mobile with services in PHP connecting to a mySql database.

You can view the site here:  http://stevenhollidge.com/blog-source-code/itineraryhuntermobile

Or download the source code here:  https://github.com/stevenh77/ItineraryHunterMobile

Here are some screenshots:

itineraryhunter-iphone1itineraryhunter-iphone2itineraryhunter-iphone3

 

This is a great tool for quickly viewing your app on different device sizes: http://quirktools.com/screenfly/

itineraryhunter-screenfly

Sunday 24 February 2013

Windows Store App Example: Itinerary Hunter

Source: https://github.com/stevenh77/ItineraryHunter-Win8

Using KONA as a framework, you can think of KONA as the Windows 8 equivalent of PRISM, I have created a Windows Store App for Itinerary Hunter.

The solution features distinct projects for UI views, UI logic (view models, converters, etc), services and tests.  Interfaces are used throughout to enable mocking for unit tests.

Here’s some screenshots of the app.

Splash screen

image

Main screen (itineraries grouped by travel categories)

image

Semantic Zoom (grouped by travel categories)

image

Beach

image

Beach category selected, now the sub categories are available

image

Tour du Mont Blanc itinerary selected

image

Delete Bin and Obj folders

Because I dont trust VS, save the following code as a “clean.bat” file in the root folder of your code:

FOR /F "tokens=*" %%G IN ('DIR /B /AD /S bin') DO RMDIR /S /Q "%%G"
FOR /F "tokens=*" %%G IN ('DIR /B /AD /S obj') DO RMDIR /S /Q "%%G"

ApplicationData.Current.TemporaryFolder for Windows Store App

Where is it?  It’s here:

C:\Users\{username}\AppData\Local\Packages\{package-guid}\TempState

Hope this helps someone out!

KendoUI: Example using remote Rest calls

This quick example is best viewed in Chrome as I’m not testing in other browsers.

The Underlyings combo is populated from a NetFlix web rest service call which do films hence the content Smile

Here's the direct link:  http://stevenhollidge.com/blog-source-code/kendoui/index.html

How to change Splash Screen colour Windows Store App

It’s hidden in the Package.appxmanifest file, scroll down and select Splash Screen (on the left hand side).

image

Friday 8 February 2013

PivotViewer bug

image

If you unload the Silverlight PivotViewer control from Visual Tree whilst it’s in the middle of loading items or an animation such as filtering or resizing, by for example changing the page in a navigation frame Silverlight crashes (see screenshot above).

The same behaviour occurs when the PivotViewer is used within the TabControl (from the Silverlight Toolkit), changing from the PivotViewer in a selected tab exhibits the same behaviour.

PivotViewer Crash Frame Demo:       https://github.com/stevenh77/PivotViewerCrashDemo

PivotViewer Crash TabControl Demo:     https://github.com/stevenh77/PivotViewerCrashTabDemo

If I rework the example and replace the frame/tab control with buttons that show/hide (visible/collapse) each of the pages then no error is thrown.

PivotViewer Working Demo:   https://github.com/stevenh77/PivotViewerWorkingDemo

Dear Microsoft, can we have a fix for the pivot viewer?

This bug has been reported to Microsoft Connect: https://connect.microsoft.com/VisualStudio/feedback/details/778981/silverlight-5-pivot-viewer-crashes-silverlight-when-removed-from-visual-tree

and also on the Silverlight forum:

http://social.msdn.microsoft.com/Forums/en-US/silverlightbugs/thread/74ba1a3e-96db-4225-852b-6b33e4e5d951