Setting MaxLength from BO


Author
Message
Bill Cunnien
Bill Cunnien
StrataFrame VIP (1.1K reputation)StrataFrame VIP (1.1K reputation)StrataFrame VIP (1.1K reputation)StrataFrame VIP (1.1K reputation)StrataFrame VIP (1.1K reputation)StrataFrame VIP (1.1K reputation)StrataFrame VIP (1.1K reputation)StrataFrame VIP (1.1K reputation)StrataFrame VIP (1.1K reputation)
Group: Forum Members
Posts: 785, Visits: 3.6K
Here is my code snippet:

private void SetAllMaxLengths(ContainerControl pContainer)
{
    MicroFour.StrataFrame.UI.Windows.Forms.DevEx.
TextEdit mBox = null;
   
foreach (Control ctrl in pContainer.Controls)
    {
        mBox = ctrl
as MicroFour.StrataFrame.UI.Windows.Forms.DevEx.TextEdit;
       
if (mBox!=null)
        {
            mBox.Properties.MaxLength = ((
BusinessLayer)mBox.BusinessObject).FieldLengths[mBox.BindingField];
        }
    }
}

I pass my form to the method.  It should iterate the controls and set the MaxLength property of each TextEdit control to the FieldLength of the bound field.  It is not doing that.  What am I doing wrong?

Thanks,
Bill

GO

Merge Selected

Merge into selected topic...



Merge into merge target...



Merge into a specific topic ID...





Similar Topics

Reading This Topic

Login

Explore
Messages
Mentions
Search