Setting MaxLength from BO


Author
Message
Bill Cunnien
Bill Cunnien
StrataFrame VIP (1.2K reputation)StrataFrame VIP (1.2K reputation)StrataFrame VIP (1.2K reputation)StrataFrame VIP (1.2K reputation)StrataFrame VIP (1.2K reputation)StrataFrame VIP (1.2K reputation)StrataFrame VIP (1.2K reputation)StrataFrame VIP (1.2K reputation)StrataFrame VIP (1.2K 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

Reply
Edhy Rijo
E
StrataFrame VIP (6.4K reputation)StrataFrame VIP (6.4K reputation)StrataFrame VIP (6.4K reputation)StrataFrame VIP (6.4K reputation)StrataFrame VIP (6.4K reputation)StrataFrame VIP (6.4K reputation)StrataFrame VIP (6.4K reputation)StrataFrame VIP (6.4K reputation)StrataFrame VIP (6.4K reputation)
Group: StrataFrame Users
Posts: 2.4K, Visits: 23K
Hi Paul, Bill,

Thanks for the ideas, I will try to implement Paul's class for the textbox and see how it works.

Edhy Rijo

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