StrataFrame Forum

Custom Field property c# - getting the table based bo to see the column

http://forum.strataframe.net/Topic30844.aspx

By Charles R Hankey - 2/2/2012

w00t

I'm missing something basic.  I have a CFP. Is there anything wrong with this? ( the four columns referenced are part of the BO )

After this BO is populated from a browsedialog, should I see a mykey column populated as shown below? 

If not, what do I have to do to make that happen? 



     #region Custom Field Properties

        [Description("mykey"), Browsable(false), DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)]
        public string mykey
            {
            get
                {
                string _mykey = this.Symbol + this.Cntry_code + this.from_date.ToString() + this.thru_date.ToString();
                return _mykey;
                }      
            }

        /// <summary>
        /// Provider property descriptors for the custom bindable fields
        /// </summary>
        protected override FieldPropertyDescriptor[] GetCustomBindablePropertyDescriptors()
            {
            //-- Return the array of property descriptors
            return new MicroFour.StrataFrame.Business.FieldPropertyDescriptor[]
            { new ReflectionPropertyDescriptor("mykey", typeof(boiSource100Symbology))};
            }
        #endregion
        }
By Edhy Rijo - 2/2/2012

Hi Charles,

Sorry, but I don't see anything wrong with the CFP.  Check your Browser Dialog, it should work straight forward.
By Charles R Hankey - 2/2/2012

The problem I'm seeing is that my currentview for the BO does not have the mykey column.  I thought creating the CFP would create that column in the view??
By Edhy Rijo - 2/2/2012

Charles R Hankey (2/2/2012)
The problem I'm seeing is that my currentview for the BO does not have the mykey column.  I thought creating the CFP would create that column in the view??

It should have the CFP.  Put a break in the CFP Get and see what are the values of  this.Symbol, this.Cntry_code,  this.from_date.ToString() and  this.thru_date.ToString()
If you don't get any value, see if the BO has any record, if so, try using this.CurrentRow.Item("Symbol") instead of the property.
By Charles R Hankey - 2/2/2012

Thanks, Eddy,  I think I'll try the Currentrow thing as I seem to remember that was the way to make it work ( boy it's been a long time since i did serious SF )
By Charles R Hankey - 2/3/2012

PLEASE !

I have a CFP, mykey.  It works fine.  The bo sees when I use it for the the browse dialog.  When I fill the bo from the browse dialog and requery my listview the column mykey is there with the proper values.

The mykey property is there on the BO with the proper value.

BUT there is no column in the datatable, the currentdatatable or the tableview, so I cannot navigate in the business object to the row with the value I seek in mykey.  (Again, I am trying to navigate in the BO based on moving in the listview.  Like autonavigate except I can't use that here as it wan't a PK and this bo has a 4 column compound pk which is why i am doing this in the first place)

If I base my BO on a view,  so I can manufacture the column, how do I use the BO for CRUD? 

I imagine I could use getenumerable and iterate the BO looking for the property, but that seems pretty ugly.

Is there are good place to slap an additional column on the BO right after it instantiates so the CFP has a place to put the data?
By Danny Doobay - 5/9/2014