diff --git a/src/feathers/controls/GridView.hx b/src/feathers/controls/GridView.hx index 3fc29573..c14e0ad9 100644 --- a/src/feathers/controls/GridView.hx +++ b/src/feathers/controls/GridView.hx @@ -1804,12 +1804,16 @@ class GridView extends BaseScrollContainer implements IIndexSelector implements var newColumns:ArrayCollection = null; if (this._dataProvider != null && this._dataProvider.length > 0) { var item = this._dataProvider.get(0); - newColumns = new ArrayCollection(Reflect.fields(item).map((fieldName) -> { - return new GridViewColumn(fieldName, (item) -> { - var propertyValue = Reflect.getProperty(item, fieldName); - return Std.string(propertyValue); - }); - })); + if ((item is String)) { + newColumns = new ArrayCollection([new GridViewColumn()]); + } else { + newColumns = new ArrayCollection(Reflect.fields(item).map((fieldName) -> { + return new GridViewColumn(fieldName, (item) -> { + var propertyValue = Reflect.getProperty(item, fieldName); + return Std.string(propertyValue); + }); + })); + } } else { newColumns = new ArrayCollection(); } diff --git a/src/feathers/controls/TreeGridView.hx b/src/feathers/controls/TreeGridView.hx index b341dcc3..9ca2b50d 100644 --- a/src/feathers/controls/TreeGridView.hx +++ b/src/feathers/controls/TreeGridView.hx @@ -1441,12 +1441,16 @@ class TreeGridView extends BaseScrollContainer implements IDataSelector var newColumns:ArrayCollection = null; if (this._dataProvider != null && this._dataProvider.getLength() > 0) { var item = this._dataProvider.get([0]); - newColumns = new ArrayCollection(Reflect.fields(item).map((fieldName) -> { - return new TreeGridViewColumn(fieldName, (item) -> { - var propertyValue = Reflect.getProperty(item, fieldName); - return Std.string(propertyValue); - }); - })); + if ((item is String)) { + newColumns = new ArrayCollection([new TreeGridViewColumn()]); + } else { + newColumns = new ArrayCollection(Reflect.fields(item).map((fieldName) -> { + return new TreeGridViewColumn(fieldName, (item) -> { + var propertyValue = Reflect.getProperty(item, fieldName); + return Std.string(propertyValue); + }); + })); + } } else { newColumns = new ArrayCollection(); }