@*   Xafari Framework version : 17.2.3011.1336   *@

@using System.Web.UI.WebControls
@model Xafari.Mvc.Editors.MvcDefaultPropertyEditor

@{
    if (this.Model.IsListMember())
    {
        var setting = new GridViewSettings();
        setting.Name = this.Model.MemberInfo.Name;
        setting.Width = Unit.Percentage(100);
        setting.Settings.ShowColumnHeaders = false;

        var column = setting.Columns.Add();
        column.Caption = this.Model.Caption;
        column.SetDataItemTemplateContent(
            a =>
            {
                var row = a.Grid.GetRow(a.VisibleIndex);
                var str = row == null ? "" : row.ToString();
                ViewContext.Writer.Write(str);
            });
        Html.DevExpress().GridView(setting).Bind(this.Model.PropertyValue).GetHtml();
    }
    else
    {
        @Model.GetPropertyDisplayValue()
    }
}