ivanblin
ivanblin

Reputation: 190

SPField.sortable returns actual value only after watching it in debug

Here is my method, that should return if field can be sorted:

public bool IsSortable(SPList list, string fieldName)
            {
                SPField field = list.Fields.GetFieldByInternalName(fieldName);

                return field.Sortable;
            }

It always returns true. But if I add a breakpoint before return and look at the properties of the field in watch window (Visual Studio 2013) in debug mode it shows me actual value of the property (true or false). And after that on continue method IsSortable returns actual value.

Upvotes: 0

Views: 35

Answers (0)

Related Questions