|
Group: Forum Members
Posts: 163,
Visits: 493
|
I've changed some property names to friendly names using custom code option in Business Object Mapper. (Plus override GetCustomBindablePropertyDescriptors for these fields) I've noticed that when this object was bind to a Devexpress Grid with business binding source, these properties were not seen in Devexpress Grid. I've tested for Devexpress (Wrapped) Textbox. These fields were listed in the BindingField list of the textbox. What is missing ?
|
|
Group: Forum Members
Posts: 163,
Visits: 493
|
After I've seen my customized property in my Devexpress Grid, I've changed all the properties with friendly names. But I've not seen these properties in Devexpress Grid. (None of them) And Retrive fields button was disabled (There is nothing to retrive for the Devexpress Grid) I could'nt understand what was happening. For Testing, I've changed back one property back to its default. (No customization). Then, I've got only this property in Devexpress Grid. And I've also tried what was happening with DataGridView, The Result was the same. Only One property in the DataGridView. My Custom Code for a field : (Use Custom Code option) [Browsable(false), BusinessFieldDisplayInEditor(), Description("Group Id"), DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)] public Nullable<System.Int32> pGroupId { get { object loValue; loValue = this.CurrentRow["group_id"]; if (loValue == DBNull.Value) { return (Nullable<System.Int32> null; } else { return new Nullable<System.Int32>((System.Int32)loValue); } } set { if (value.HasValue) { this.CurrentRow["group_id"] = value.Value; } else { this.CurrentRow["group_id"] = DBNull.Value; } } } My Method protected override FieldPropertyDescriptor[] GetCustomBindablePropertyDescriptors(){ return new FieldPropertyDescriptor[] { new ReflectionPropertyDescriptor("pId", typeof(CompaniesBase)),new ReflectionPropertyDescriptor("pGroupId", typeof(CompaniesBase)),// new ReflectionPropertyDescriptor("pCode", typeof(CompaniesBase)),new ReflectionPropertyDescriptor("pName", typeof(CompaniesBase)),new ReflectionPropertyDescriptor("pCityId", typeof(CompaniesBase)),new ReflectionPropertyDescriptor("pTownId", typeof(CompaniesBase)),new ReflectionPropertyDescriptor("pCountryId", typeof(CompaniesBase)),new ReflectionPropertyDescriptor("pZipCode", typeof(CompaniesBase)),new ReflectionPropertyDescriptor("pAdress", typeof(CompaniesBase)),new ReflectionPropertyDescriptor("pPhone1", typeof(CompaniesBase)),new ReflectionPropertyDescriptor("pPhone2", typeof(CompaniesBase)),new ReflectionPropertyDescriptor("pFax", typeof(CompaniesBase)),new ReflectionPropertyDescriptor("pRelatedPerson", typeof(CompaniesBase)),new ReflectionPropertyDescriptor("pEmailAdress", typeof(CompaniesBase)),new ReflectionPropertyDescriptor("pWebSiteAdress", typeof(CompaniesBase)),new ReflectionPropertyDescriptor("pTaxNumber", typeof(CompaniesBase)),new ReflectionPropertyDescriptor("pTaxOffice", typeof(CompaniesBase)),new ReflectionPropertyDescriptor("pPhoto", typeof(CompaniesBase)),new ReflectionPropertyDescriptor("pType", typeof(CompaniesBase)),new ReflectionPropertyDescriptor("pIsActive", typeof(CompaniesBase)),new ReflectionPropertyDescriptor("pRecordStamp", typeof(CompaniesBase)),new ReflectionPropertyDescriptor("pInsertedByUser", typeof(CompaniesBase)),new ReflectionPropertyDescriptor("pClientAccountId", typeof(CompaniesBase)),new ReflectionPropertyDescriptor("pCreditAmount", typeof(CompaniesBase))}; }
|
|
Group: StrataFrame Developers
Posts: 6.6K,
Visits: 7K
|
What does the declaration of your BO class look like? In the GetCustomBindablePropertyDescriptors method, you are using the type of CompaniesBase, is this the class that your custom properties are defined within? There is really not much that has to be done....if you have type descriptors create or have them defined in the GetCustomBindablePropertyDescriptors method, they should show up. What does your BO Mapper settings for one of your custom properties look like? Do you have any other options checked, like the Create Descriptor? If so, then this is probably your issue. You do not need that checked since you are defining the GetCustomBindablePropertyDescriptors.
|