c# - How to use int.TryParse with nullable int? - Stack Overflow
You could also make an extension method for this purpose; public static bool TryParse(this object value, out int? parsed) { parsed = null; try { if (value == null) return true; int parsedValue; parsed = int.TryParse(value.ToString(), out ......