Exemple #1
0
 public override void Setup(DevExpress.ExpressApp.IObjectSpace objectSpace, DevExpress.ExpressApp.XafApplication application)
 {
     //_objectSpace = objectSpace;
     //_application = application;
     base.Setup(objectSpace, application);
     helper = new WebLookupEditorHelper(application, objectSpace, MemberInfo.MemberTypeInfo, Model);
 }
Exemple #2
0
 public override void Setup(IObjectSpace space, XafApplication xafApplication)
 {
     base.Setup(space, xafApplication);
     _application = application;
     _objectSpace = objectSpace;
     _helper      = new WebLookupEditorHelper(xafApplication, space, MemberInfo.MemberTypeInfo, Model);
 }
        public override void Setup(IObjectSpace space, XafApplication xafApplication)
        {
            base.Setup(space, xafApplication);
            var modelClientDatasource = xafApplication.ReactiveModulesModel().LookupCascadeModel().Select(_ => _.ClientDatasource).Wait();

            _helper = new WebLookupEditorHelper(xafApplication, space, MemberInfo.MemberTypeInfo, Model)
            {
                EditorMode = LookupEditorMode.AllItems
            };
            ImmediatePostData = false;
            var lookupListViewModel = _helper.LookupListViewModel;

            _lookupViewModelMemberViewItems = lookupListViewModel.VisibleMemberViewItems().OrderForView();
            _clientStorage = modelClientDatasource.ClientStorage.ToString().FirstCharacterToLower();
        }
        public ASPxSearchDropDownEdit(WebLookupEditorHelper helper, string emptyValue, string displayFormat)
        {
            this.Helper        = helper;
            this.EmptyValue    = emptyValue;
            this.DisplayFormat = displayFormat;

            dropDown          = RenderHelper.CreateASPxComboBox();
            dropDown.ID       = "DD";
            dropDown.Width    = Unit.Percentage(100);
            dropDown.CssClass = "xafLookupEditor";
            dropDown.IncrementalFilteringMode         = DevExpress.Web.IncrementalFilteringMode.Contains;
            dropDown.DropDownButton.Visible           = false;
            dropDown.EnableCallbackMode               = true;
            dropDown.CallbackPageSize                 = 10;
            dropDown.ItemRequestedByValue            += new DevExpress.Web.ListEditItemRequestedByValueEventHandler(dropDown_ItemRequestedByValue);
            dropDown.ItemsRequestedByFilterCondition += new DevExpress.Web.ListEditItemsRequestedByFilterConditionEventHandler(dropDown_ItemsRequestedByFilterCondition);

            dropDown.TextField  = Helper.DisplayMember.Name;
            dropDown.ValueField = Helper.LookupObjectTypeInfo.KeyMember.Name;
            //dropDown.ValueField = String.Format("{0}({1})", Helper.LookupObjectTypeInfo.ToString(), Helper.LookupObjectTypeInfo.KeyMember.Name);
            //TODO Add columns
            if (Helper.LookupObjectTypeInfo.Type.FullName == "MainDemo.Module.BusinessObjects.Contact")
            {
                dropDown.Columns.Add("FullName", "FullName", 300);
                dropDown.Columns.Add("SpouseName", "SpouseName", 300);
                dropDown.TextFormatString = "{0} {1}";
            }

            newButton   = dropDown.Buttons.Add();
            clearButton = dropDown.Buttons.Add();
            ASPxImageHelper.SetImageProperties(newButton.Image, "Action_New_12x12");
            ASPxImageHelper.SetImageProperties(clearButton.Image, "Editor_Clear");

            CellPadding = 0;
            CellSpacing = 0;
            Rows.Add(new TableRow());
            Rows[0].Cells.Add(new TableCell());

            Rows[0].Cells[0].Width = Unit.Percentage(100);
            Rows[0].Cells[0].Attributes["align"]  = "left";
            Rows[0].Cells[0].Attributes["valign"] = "middle";
            Rows[0].Cells[0].Controls.Add(dropDown);
        }
Exemple #5
0
        public ASPxSearchDropDownEdit(WebLookupEditorHelper helper, string emptyValue, string displayFormat)
        {
            Helper        = helper;
            EmptyValue    = emptyValue;
            DisplayFormat = displayFormat;

            _dropDown          = RenderHelper.CreateASPxComboBox();
            _dropDown.ID       = "DD";
            _dropDown.Width    = Unit.Percentage(100);
            _dropDown.CssClass = "xafLookupEditor";

            // the following properties would be nice to be read from the model
            _dropDown.IncrementalFilteringMode = IncrementalFilteringMode.StartsWith;
            _dropDown.FilterMinLength          = 3;

            _dropDown.DropDownButton.Visible           = false;
            _dropDown.EnableCallbackMode               = true;
            _dropDown.CallbackPageSize                 = 10;
            _dropDown.ItemRequestedByValue            += dropDown_ItemRequestedByValue;
            _dropDown.ItemsRequestedByFilterCondition += dropDown_ItemsRequestedByFilterCondition;

            _dropDown.TextField  = Helper.DisplayMember.Name;
            _dropDown.ValueField = Helper.LookupObjectTypeInfo.KeyMember.Name;
            _dropDown.Columns.Add(Helper.LookupObjectTypeInfo.DefaultMember.BindingName);

            /*if (Helper.LookupObjectTypeInfo.Type.FullName == "MainDemo.Module.BusinessObjects.Contact")
             * {
             *  dropDown.Columns.Add("FullName", "FullName", 300);
             *  dropDown.Columns.Add("SpouseName", "SpouseName", 300);
             *  dropDown.TextFormatString = "{0} {1}";
             * }*/

            _newButton   = _dropDown.Buttons.Add();
            _clearButton = _dropDown.Buttons.Add();
            ASPxImageHelper.SetImageProperties(_newButton.Image, "Action_New_12x12");
            ASPxImageHelper.SetImageProperties(_clearButton.Image, "Editor_Clear");

            InitTable();
        }
Exemple #6
0
 public void Setup(IObjectSpace objectSpace, XafApplication application)
 {
     Helper      = new WebLookupEditorHelper(application, objectSpace, MemberInfo.MemberTypeInfo, Model);
     ObjectSpace = objectSpace;
 }
Exemple #7
0
 public void Setup(IObjectSpace objectSpace, XafApplication application)
 {
     _objectSpace = objectSpace;
     _helper      = new WebLookupEditorHelper(application, objectSpace, MemberInfo.ListElementTypeInfo, Model);
 }
        public ASPxSearchDropDownEdit(WebLookupEditorHelper helper, string emptyValue, string displayFormat) {
            Helper = helper;
            EmptyValue = emptyValue;
            DisplayFormat = displayFormat;

            dropDown = RenderHelper.CreateASPxComboBox();
            dropDown.ID = "DD";
            dropDown.Width = Unit.Percentage(100);
            dropDown.CssClass = "xafLookupEditor";

            // the following properties would be nice to be read from the model
            dropDown.IncrementalFilteringMode = IncrementalFilteringMode.StartsWith;
            dropDown.FilterMinLength = 3;

            dropDown.DropDownButton.Visible = false;
            dropDown.EnableCallbackMode = true;
            dropDown.CallbackPageSize = 10;
            dropDown.ItemRequestedByValue += dropDown_ItemRequestedByValue;
            dropDown.ItemsRequestedByFilterCondition += dropDown_ItemsRequestedByFilterCondition;

            dropDown.TextField = Helper.DisplayMember.Name;
            dropDown.ValueField = Helper.LookupObjectTypeInfo.KeyMember.Name;
            dropDown.Columns.Add(Helper.LookupObjectTypeInfo.DefaultMember.BindingName);
            /*if (Helper.LookupObjectTypeInfo.Type.FullName == "MainDemo.Module.BusinessObjects.Contact")
            {
                dropDown.Columns.Add("FullName", "FullName", 300);
                dropDown.Columns.Add("SpouseName", "SpouseName", 300);
                dropDown.TextFormatString = "{0} {1}";
            }*/

            newButton = dropDown.Buttons.Add();
            clearButton = dropDown.Buttons.Add();
            ASPxImageHelper.SetImageProperties(newButton.Image, "Action_New_12x12");
            ASPxImageHelper.SetImageProperties(clearButton.Image, "Editor_Clear");

            InitTable();
        }
 public override void Setup(IObjectSpace space, XafApplication xafApplication) {
     base.Setup(space, xafApplication);
     _application = application;
     _objectSpace = objectSpace;
     helper = new WebLookupEditorHelper(xafApplication, space, MemberInfo.MemberTypeInfo, Model);
 }
Exemple #10
0
        private ASPxEdit GetControlForColumn(IModelColumn column, XPBaseObject item)
        {
            object   value = item.GetMemberValue(column.PropertyName);
            ASPxEdit c;

            if (typeof(XPBaseObject).IsAssignableFrom(column.ModelMember.MemberInfo.MemberType))
            {
                c = RenderHelper.CreateASPxComboBox();
                var helper = new WebLookupEditorHelper(_application, _objectSpace,
                                                       column.ModelMember.MemberInfo.MemberTypeInfo, column);

                ((ASPxComboBox)c).ClientSideEvents.KeyUp =
                    "function(s, e) { if(e.htmlEvent.keyCode == 46){ s.SetSelectedIndex(-1); } }";
                ((ASPxComboBox)c).ValueType             = column.ModelMember.MemberInfo.MemberTypeInfo.KeyMember.MemberType;
                ((ASPxComboBox)c).SelectedIndexChanged += DetailItemControlValueChanged;
                c.Style.Add("min-width", "120px");
                c.Width = new Unit(100, UnitType.Percentage);

                FillEditorValues(value, ((ASPxComboBox)c), helper, item, column.ModelMember);
                if (column.ModelMember.MemberInfo.FindAttribute <ImmediatePostDataAttribute>() != null)
                {
                    ((ASPxComboBox)c).ClientSideEvents.SelectedIndexChanged = "function(s, e) { " + "CallbackPanel" +
                                                                              Model.Id + ".PerformCallback(\"changed_" +
                                                                              column.PropertyName + "_" +
                                                                              item.GetMemberValue(
                        Model.ModelClass.KeyProperty) +
                                                                              "\"); }";
                }
            }
            else if (typeof(Enum).IsAssignableFrom(column.ModelMember.MemberInfo.MemberType))
            {
                c = RenderHelper.CreateASPxComboBox();
                ((ASPxComboBox)c).ClientSideEvents.KeyUp =
                    "function(s, e) { if(e.htmlEvent.keyCode == 46){ s.SetSelectedIndex(-1); } }";
                var descriptor = new EnumDescriptor(column.ModelMember.MemberInfo.MemberType);
                var source     = (Enum.GetValues(column.ModelMember.MemberInfo.MemberType).Cast <object>()
                                  .Select(v => new Tuple <object, string>(v, descriptor.GetCaption(v)))).ToList();
                c.DataSource = source;
                ((ASPxComboBox)c).ValueField            = "Item1";
                ((ASPxComboBox)c).TextField             = "Item2";
                ((ASPxComboBox)c).ValueType             = column.ModelMember.MemberInfo.MemberType;
                ((ASPxComboBox)c).SelectedIndexChanged += DetailItemControlValueChanged;
                c.Style.Add("min-width", "120px");
                c.Width = new Unit(100, UnitType.Percentage);
                c.Load += c_Load;
                if (column.ModelMember.MemberInfo.FindAttribute <ImmediatePostDataAttribute>() != null)
                {
                    ((ASPxComboBox)c).ClientSideEvents.SelectedIndexChanged = "function(s, e) { " + "CallbackPanel" +
                                                                              Model.Id + ".PerformCallback(\"changed_" +
                                                                              column.PropertyName + "_" +
                                                                              item.GetMemberValue(
                        Model.ModelClass.KeyProperty) +
                                                                              "\"); }";
                }
            }
            else
            {
                switch (column.ModelMember.MemberInfo.MemberType.ToString())
                {
                case "System.Boolean":
                case "System.bool":
                    c = RenderHelper.CreateASPxCheckBox();
                    ((ASPxCheckBox)c).CheckedChanged += DetailItemControlValueChanged;
                    c.Style.Add("max-width", "20px");
                    if (column.ModelMember.MemberInfo.FindAttribute <ImmediatePostDataAttribute>() != null)
                    {
                        ((ASPxCheckBox)c).ClientSideEvents.CheckedChanged = "function(s, e) { " + "CallbackPanel" +
                                                                            Model.Id +
                                                                            ".PerformCallback(\"changed_" +
                                                                            column.PropertyName + "_" +
                                                                            item.GetMemberValue(
                            Model.ModelClass.KeyProperty) +
                                                                            "\"); }";
                    }
                    break;

                case "System.String":
                case "System.string":
                    c = RenderHelper.CreateASPxTextBox();
                    ((ASPxTextBox)c).MaxLength = 100;
                    if (column.ModelMember.Size > 0)
                    {
                        ((ASPxTextBox)c).MaxLength = column.ModelMember.Size;
                    }
                    ((ASPxTextBox)c).TextChanged += DetailItemControlValueChanged;
                    if (column.ModelMember.MemberInfo.FindAttribute <ImmediatePostDataAttribute>() != null)
                    {
                        ((ASPxTextBox)c).ClientSideEvents.TextChanged = "function(s, e) { " + "CallbackPanel" +
                                                                        Model.Id + ".PerformCallback(\"changed_" +
                                                                        column.PropertyName + "_" +
                                                                        item.GetMemberValue(
                            Model.ModelClass.KeyProperty) +
                                                                        "\"); }";
                    }
                    c.Style.Add("min-width", "130px");
                    break;

                case "System.Int32":
                case "System.int":
                case "System.Int64":
                case "System.long":
                    c = RenderHelper.CreateASPxSpinEdit();
                    ((ASPxSpinEdit)c).NumberType    = SpinEditNumberType.Integer;
                    ((ASPxSpinEdit)c).DecimalPlaces = 0;
                    c.ValueChanged += DetailItemControlValueChanged;
                    if (column.ModelMember.MemberInfo.FindAttribute <ImmediatePostDataAttribute>() != null)
                    {
                        ((ASPxSpinEdit)c).ClientSideEvents.NumberChanged = "function(s, e) { " + "CallbackPanel" +
                                                                           Model.Id + ".PerformCallback(\"changed_" +
                                                                           column.PropertyName + "_" +
                                                                           item.GetMemberValue(
                            Model.ModelClass.KeyProperty) +
                                                                           "\"); }";
                    }
                    c.Style.Add("min-width", "100px");
                    break;

                case "System.Double":
                case "System.double":
                case "System.Decimal":
                case "System.decimal":
                case "System.Nullable`1[System.Decimal]":
                    c = RenderHelper.CreateASPxSpinEdit();
                    ((ASPxSpinEdit)c).NumberType = SpinEditNumberType.Float;
                    string format = column.ModelMember.DisplayFormat;
                    if (format == "{0:C}")
                    {
                        format = null;
                    }
                    ((ASPxSpinEdit)c).DisplayFormatString = format;
                    if (string.IsNullOrEmpty(format))
                    {
                        ((ASPxSpinEdit)c).DecimalPlaces = 2;
                    }
                    c.ValueChanged += DetailItemControlValueChanged;
                    if (column.ModelMember.MemberInfo.FindAttribute <ImmediatePostDataAttribute>() != null)
                    {
                        ((ASPxSpinEdit)c).ClientSideEvents.NumberChanged = "function(s, e) { " + "CallbackPanel" +
                                                                           Model.Id + ".PerformCallback(\"changed_" +
                                                                           column.PropertyName + "_" +
                                                                           item.GetMemberValue(
                            Model.ModelClass.KeyProperty) +
                                                                           "\"); }";
                    }
                    c.Style.Add("min-width", "100px");
                    break;

                case "System.DateTime":
                    c = RenderHelper.CreateASPxDateEdit();
                    ((ASPxDateEdit)c).DateChanged += DetailItemControlValueChanged;
                    if (column.ModelMember.MemberInfo.FindAttribute <ImmediatePostDataAttribute>() != null)
                    {
                        ((ASPxDateEdit)c).ClientSideEvents.DateChanged = "function(s, e) { " + "CallbackPanel" +
                                                                         Model.Id + ".PerformCallback(\"changed_" +
                                                                         column.PropertyName + "_" +
                                                                         item.GetMemberValue(
                            Model.ModelClass.KeyProperty) +
                                                                         "\"); }";
                    }
                    c.Style.Add("min-width", "90px");

                    break;

                default:
                    c = RenderHelper.CreateASPxTextBox();
                    ((ASPxTextBox)c).MaxLength    = 100;
                    ((ASPxTextBox)c).TextChanged += DetailItemControlValueChanged;
                    if (column.ModelMember.MemberInfo.FindAttribute <ImmediatePostDataAttribute>() != null)
                    {
                        ((ASPxTextBox)c).ClientSideEvents.TextChanged = "function(s, e) { " + "CallbackPanel" +
                                                                        Model.Id + ".PerformCallback(\"changed_" +
                                                                        column.PropertyName + "_" +
                                                                        item.GetMemberValue(
                            Model.ModelClass.KeyProperty) +
                                                                        "\"); }";
                    }
                    c.Style.Add("min-width", "130px");
                    break;
                }
                c.Width = new Unit(100, UnitType.Percentage);
            }

            SetValueToControl(value, c);
            _controls.Add(c);

            OnControlCreated(column.PropertyName, c, item);

            return(c);
        }
Exemple #11
0
 private void FillEditorValues(object currentSelectedObject, ASPxComboBox control, WebLookupEditorHelper helper,
                               object currentObject, IModelMember member)
 {
     control.Items.Clear();
     control.Items.Add(WebPropertyEditor.EmptyValue, null);
     control.SelectedIndex = 0;
     if (currentObject != null)
     {
         CollectionSourceBase dataSource = helper.CreateCollectionSource(currentObject);
         if (dataSource != null)
         {
             helper.ReloadCollectionSource(dataSource, currentObject);
         }
         else
         {
             throw new NullReferenceException("currentSelectedObject");
         }
         var list = new ArrayList();
         if (dataSource.List != null)
         {
             foreach (object t in dataSource.List)
             {
                 list.Add(t);
             }
         }
         else
         {
             if (currentSelectedObject != null)
             {
                 control.Items.Add(
                     helper.GetEscapedDisplayText(currentSelectedObject, WebPropertyEditor.EmptyValue,
                                                  member.DisplayFormat), -1);
                 control.SelectedIndex = 1;
             }
             return;
         }
         if (currentSelectedObject != null && (list.IndexOf(currentSelectedObject) == -1))
         {
             list.Add(currentSelectedObject);
         }
         list.Sort(new DisplayValueComparer(helper, WebPropertyEditor.EmptyValue));
         foreach (object obj in list)
         {
             control.Items.Add(
                 helper.GetEscapedDisplayText(obj, WebPropertyEditor.EmptyValue, member.DisplayFormat),
                 ((XPBaseObject)obj).GetMemberValue(helper.LookupObjectTypeInfo.KeyMember.Name));
             // helper.GetObjectKey(obj));
             if (currentSelectedObject == obj)
             {
                 if (obj != null)
                 {
                     control.SelectedIndex = list.IndexOf(obj) + 1;
                 }
             }
         }
     }
 }
 public override void Setup(IObjectSpace objectSpace, XafApplication application)
 {
     base.Setup(objectSpace, application);
     helper = new WebLookupEditorHelper(application, objectSpace, MemberInfo.MemberTypeInfo, Model);
 }
 private void FillEditorValues(object currentSelectedObject, ASPxComboBox control, WebLookupEditorHelper helper,
     object currentObject, IModelMember member){
     control.Items.Clear();
     control.Items.Add(WebPropertyEditor.EmptyValue, null);
     control.SelectedIndex = 0;
     if (currentObject != null){
         CollectionSourceBase dataSource = helper.CreateCollectionSource(currentObject);
         if (dataSource != null){
             helper.ReloadCollectionSource(dataSource, currentObject);
         }
         else{
             throw new NullReferenceException("currentSelectedObject");
         }
         var list = new ArrayList();
         if (dataSource.List != null){
             foreach (object t in dataSource.List){
                 list.Add(t);
             }
         }
         else{
             if (currentSelectedObject != null){
                 control.Items.Add(
                     helper.GetEscapedDisplayText(currentSelectedObject, WebPropertyEditor.EmptyValue,
                         member.DisplayFormat), -1);
                 control.SelectedIndex = 1;
             }
             return;
         }
         if (currentSelectedObject != null && (list.IndexOf(currentSelectedObject) == -1)){
             list.Add(currentSelectedObject);
         }
         list.Sort(new DisplayValueComparer(helper, WebPropertyEditor.EmptyValue));
         foreach (object obj in list){
             control.Items.Add(
                 helper.GetEscapedDisplayText(obj, WebPropertyEditor.EmptyValue, member.DisplayFormat),
                 ((XPBaseObject) obj).GetMemberValue(helper.LookupObjectTypeInfo.KeyMember.Name));
                 // helper.GetObjectKey(obj));
             if (currentSelectedObject == obj){
                 if (obj != null) control.SelectedIndex = list.IndexOf(obj) + 1;
             }
         }
     }
 }
        private ASPxEdit GetControlForColumn(IModelColumn column, XPBaseObject item){
            object value = item.GetMemberValue(column.PropertyName);
            ASPxEdit c;
            if (typeof (XPBaseObject).IsAssignableFrom(column.ModelMember.MemberInfo.MemberType)){
                c = RenderHelper.CreateASPxComboBox();
                var helper = new WebLookupEditorHelper(_application, _objectSpace,
                    column.ModelMember.MemberInfo.MemberTypeInfo, column);

                ((ASPxComboBox) c).ClientSideEvents.KeyUp =
                    "function(s, e) { if(e.htmlEvent.keyCode == 46){ s.SetSelectedIndex(-1); } }";
                ((ASPxComboBox) c).ValueType = column.ModelMember.MemberInfo.MemberTypeInfo.KeyMember.MemberType;
                ((ASPxComboBox) c).SelectedIndexChanged += DetailItemControlValueChanged;
                c.Style.Add("min-width", "120px");
                c.Width = new Unit(100, UnitType.Percentage);

                FillEditorValues(value, ((ASPxComboBox) c), helper, item, column.ModelMember);
                if (column.ModelMember.MemberInfo.FindAttribute<ImmediatePostDataAttribute>() != null)
                    ((ASPxComboBox) c).ClientSideEvents.SelectedIndexChanged = "function(s, e) { " + "CallbackPanel" +
                                                                               Model.Id + ".PerformCallback(\"changed_" +
                                                                               column.PropertyName + "_" +
                                                                               item.GetMemberValue(
                                                                                   Model.ModelClass.KeyProperty) +
                                                                               "\"); }";
            }
            else if (typeof (Enum).IsAssignableFrom(column.ModelMember.MemberInfo.MemberType)){
                c = RenderHelper.CreateASPxComboBox();
                ((ASPxComboBox) c).ClientSideEvents.KeyUp =
                    "function(s, e) { if(e.htmlEvent.keyCode == 46){ s.SetSelectedIndex(-1); } }";
                var descriptor = new EnumDescriptor(column.ModelMember.MemberInfo.MemberType);
                var source = (Enum.GetValues(column.ModelMember.MemberInfo.MemberType).Cast<object>()
                    .Select(v => new Tuple<object, string>(v, descriptor.GetCaption(v)))).ToList();
                c.DataSource = source;
                ((ASPxComboBox) c).ValueField = "Item1";
                ((ASPxComboBox) c).TextField = "Item2";
                ((ASPxComboBox) c).ValueType = column.ModelMember.MemberInfo.MemberType;
                ((ASPxComboBox) c).SelectedIndexChanged += DetailItemControlValueChanged;
                c.Style.Add("min-width", "120px");
                c.Width = new Unit(100, UnitType.Percentage);
                c.Load += c_Load;
                if (column.ModelMember.MemberInfo.FindAttribute<ImmediatePostDataAttribute>() != null)
                    ((ASPxComboBox) c).ClientSideEvents.SelectedIndexChanged = "function(s, e) { " + "CallbackPanel" +
                                                                               Model.Id + ".PerformCallback(\"changed_" +
                                                                               column.PropertyName + "_" +
                                                                               item.GetMemberValue(
                                                                                   Model.ModelClass.KeyProperty) +
                                                                               "\"); }";
            }
            else{
                switch (column.ModelMember.MemberInfo.MemberType.ToString()){
                    case "System.Boolean":
                    case "System.bool":
                        c = RenderHelper.CreateASPxCheckBox();
                        ((ASPxCheckBox) c).CheckedChanged += DetailItemControlValueChanged;
                        c.Style.Add("max-width", "20px");
                        if (column.ModelMember.MemberInfo.FindAttribute<ImmediatePostDataAttribute>() != null)
                            ((ASPxCheckBox) c).ClientSideEvents.CheckedChanged = "function(s, e) { " + "CallbackPanel" +
                                                                                 Model.Id +
                                                                                 ".PerformCallback(\"changed_" +
                                                                                 column.PropertyName + "_" +
                                                                                 item.GetMemberValue(
                                                                                     Model.ModelClass.KeyProperty) +
                                                                                 "\"); }";
                        break;
                    case "System.String":
                    case "System.string":
                        c = RenderHelper.CreateASPxTextBox();
                        ((ASPxTextBox) c).MaxLength = 100;
                        if (column.ModelMember.Size > 0)
                            ((ASPxTextBox) c).MaxLength = column.ModelMember.Size;
                        ((ASPxTextBox) c).TextChanged += DetailItemControlValueChanged;
                        if (column.ModelMember.MemberInfo.FindAttribute<ImmediatePostDataAttribute>() != null)
                            ((ASPxTextBox) c).ClientSideEvents.TextChanged = "function(s, e) { " + "CallbackPanel" +
                                                                             Model.Id + ".PerformCallback(\"changed_" +
                                                                             column.PropertyName + "_" +
                                                                             item.GetMemberValue(
                                                                                 Model.ModelClass.KeyProperty) +
                                                                             "\"); }";
                        c.Style.Add("min-width", "130px");
                        break;
                    case "System.Int32":
                    case "System.int":
                    case "System.Int64":
                    case "System.long":
                        c = RenderHelper.CreateASPxSpinEdit();
                        ((ASPxSpinEdit) c).NumberType = SpinEditNumberType.Integer;
                        ((ASPxSpinEdit) c).DecimalPlaces = 0;
                        c.ValueChanged += DetailItemControlValueChanged;
                        if (column.ModelMember.MemberInfo.FindAttribute<ImmediatePostDataAttribute>() != null)
                            ((ASPxSpinEdit) c).ClientSideEvents.NumberChanged = "function(s, e) { " + "CallbackPanel" +
                                                                                Model.Id + ".PerformCallback(\"changed_" +
                                                                                column.PropertyName + "_" +
                                                                                item.GetMemberValue(
                                                                                    Model.ModelClass.KeyProperty) +
                                                                                "\"); }";
                        c.Style.Add("min-width", "100px");
                        break;
                    case "System.Double":
                    case "System.double":
                    case "System.Decimal":
                    case "System.decimal":
                    case "System.Nullable`1[System.Decimal]":
                        c = RenderHelper.CreateASPxSpinEdit();
                        ((ASPxSpinEdit) c).NumberType = SpinEditNumberType.Float;
                        string format = column.ModelMember.DisplayFormat;
                        if (format == "{0:C}") format = null;
                        ((ASPxSpinEdit) c).DisplayFormatString = format;
                        if (string.IsNullOrEmpty(format))
                            ((ASPxSpinEdit) c).DecimalPlaces = 2;
                        c.ValueChanged += DetailItemControlValueChanged;
                        if (column.ModelMember.MemberInfo.FindAttribute<ImmediatePostDataAttribute>() != null)
                            ((ASPxSpinEdit) c).ClientSideEvents.NumberChanged = "function(s, e) { " + "CallbackPanel" +
                                                                                Model.Id + ".PerformCallback(\"changed_" +
                                                                                column.PropertyName + "_" +
                                                                                item.GetMemberValue(
                                                                                    Model.ModelClass.KeyProperty) +
                                                                                "\"); }";
                        c.Style.Add("min-width", "100px");
                        break;
                    case "System.DateTime":
                        c = RenderHelper.CreateASPxDateEdit();
                        ((ASPxDateEdit) c).DateChanged += DetailItemControlValueChanged;
                        if (column.ModelMember.MemberInfo.FindAttribute<ImmediatePostDataAttribute>() != null)
                            ((ASPxDateEdit) c).ClientSideEvents.DateChanged = "function(s, e) { " + "CallbackPanel" +
                                                                              Model.Id + ".PerformCallback(\"changed_" +
                                                                              column.PropertyName + "_" +
                                                                              item.GetMemberValue(
                                                                                  Model.ModelClass.KeyProperty) +
                                                                              "\"); }";
                        c.Style.Add("min-width", "90px");

                        break;
                    default:
                        c = RenderHelper.CreateASPxTextBox();
                        ((ASPxTextBox) c).MaxLength = 100;
                        ((ASPxTextBox) c).TextChanged += DetailItemControlValueChanged;
                        if (column.ModelMember.MemberInfo.FindAttribute<ImmediatePostDataAttribute>() != null)
                            ((ASPxTextBox) c).ClientSideEvents.TextChanged = "function(s, e) { " + "CallbackPanel" +
                                                                             Model.Id + ".PerformCallback(\"changed_" +
                                                                             column.PropertyName + "_" +
                                                                             item.GetMemberValue(
                                                                                 Model.ModelClass.KeyProperty) +
                                                                             "\"); }";
                        c.Style.Add("min-width", "130px");
                        break;
                }
                c.Width = new Unit(100, UnitType.Percentage);
            }

            SetValueToControl(value, c);
            _controls.Add(c);

            OnControlCreated(column.PropertyName, c, item);

            return c;
        }