Two quick questions...


Author
Message
Ulrik Mueller
Ulrik Mueller
StrataFrame Beginner (24 reputation)StrataFrame Beginner (24 reputation)StrataFrame Beginner (24 reputation)StrataFrame Beginner (24 reputation)StrataFrame Beginner (24 reputation)StrataFrame Beginner (24 reputation)StrataFrame Beginner (24 reputation)StrataFrame Beginner (24 reputation)StrataFrame Beginner (24 reputation)
Group: Forum Members
Posts: 18, Visits: 59
1. I'm using ComboBox with enumerated lists.  How do I override the enumeration text in the ComboBox dropdownlist ?

2. I'm trying to work with a BO entirely from code (C#) - creation, calling a method on the BO and finally disposing.  I am getting blind onto the correct way of doing this.  HELP......

Looking forward to hear from you all ;-)

Regards
Ulrik

Edhy Rijo
E
StrataFrame VIP (4.7K reputation)StrataFrame VIP (4.7K reputation)StrataFrame VIP (4.7K reputation)StrataFrame VIP (4.7K reputation)StrataFrame VIP (4.7K reputation)StrataFrame VIP (4.7K reputation)StrataFrame VIP (4.7K reputation)StrataFrame VIP (4.7K reputation)StrataFrame VIP (4.7K reputation)
Group: StrataFrame Users
Posts: 2.4K, Visits: 23K
Hi Ulrik,



Ulrik Mueller (06/18/2009)
1. I'm using ComboBox with enumerated lists. How do I override the enumeration text in the ComboBox dropdownlist ?




For this you can use the < EnumDispayValue() > from the MicroFour.StrataFrame.Tools, here is sample in VB:





Imports MicroFour.StrataFrame.Tools



Public Enum eMailSendFormat As Integer

< EnumDisplayValue("Acrobat (PDF)") > _

Acrobat_PDF = 1



< EnumDisplayValue("Comma Separated Values (Windows-CSV)") > _

CSV = 2

End Enum





2. I'm trying to work with a BO entirely from code (C#) - creation, calling a method on the BO and finally disposing. I am getting blind onto the correct way of doing this. HELP......




I am not sure I totaly understand your request here, but here is sample in VB of how to use a SF BO:



Using bo As bizItems = New bizItems

bo.FillByPrimaryKey(pPK_Items)

If bo.Count = 1 Then

Return bo.ItemName

Else

Return String.Empty

End If

End Using




Edhy Rijo

Greg McGuffey
Greg McGuffey
Strategic Support Team Member (3.5K reputation)
Group: Forum Members
Posts: 2K, Visits: 6.6K
C# versions:



To change text displayed in an SF combo that is loaded from an enum, set an attribute on each item within the enum:



using MicroFour.StrataFrame.Tools



public enum eMailSendFormat {

  // This will now display "Acrobat (PDF)" in combo

  [EnumDisplayValue("Acrobat (PDF)")]

  Acrobat_PDF = 1;



  // This will now display "Comma Separated Values (Windows-CSV)" in combo

  [EnumDisplayValue("Comma Separated Values (Windows-CSV)")]

  CSV = 2;

}




The 'using' statement in C# (Using in VB.NET) are used to ensure that disposable objects get disposed. I.e. when the using block is exited, the item is disposed. This occurs whether the code runs it course, you break out of it or an exception occurs within the block.



using CustomerBO customers = new CustomerBO() {

  customers.FillByCity("Munich");

} // calls customers.Dispose() automatically when this block exits

Ulrik Mueller
Ulrik Mueller
StrataFrame Beginner (24 reputation)StrataFrame Beginner (24 reputation)StrataFrame Beginner (24 reputation)StrataFrame Beginner (24 reputation)StrataFrame Beginner (24 reputation)StrataFrame Beginner (24 reputation)StrataFrame Beginner (24 reputation)StrataFrame Beginner (24 reputation)StrataFrame Beginner (24 reputation)
Group: Forum Members
Posts: 18, Visits: 59
Thanks for the assist - it is working perfectly!   Watch out, i am sure that i'll be back soon with another "simpel" question!

Best regards
Ulrik

Greg McGuffey
Greg McGuffey
Strategic Support Team Member (3.5K reputation)
Group: Forum Members
Posts: 2K, Visits: 6.6K
Any time! BigGrin
Edhy Rijo
E
StrataFrame VIP (4.7K reputation)StrataFrame VIP (4.7K reputation)StrataFrame VIP (4.7K reputation)StrataFrame VIP (4.7K reputation)StrataFrame VIP (4.7K reputation)StrataFrame VIP (4.7K reputation)StrataFrame VIP (4.7K reputation)StrataFrame VIP (4.7K reputation)StrataFrame VIP (4.7K reputation)
Group: StrataFrame Users
Posts: 2.4K, Visits: 23K
Ulrik Mueller (06/18/2009)
Thanks for the assist - it is working perfectly!




Not a problem, glad it worked and it was easy for you. Cool



Greg, thanks for the C# translation Hehe

Edhy Rijo

Trent Taylor
Trent Taylor
StrataFrame Developer (10K reputation)StrataFrame Developer (10K reputation)StrataFrame Developer (10K reputation)StrataFrame Developer (10K reputation)StrataFrame Developer (10K reputation)StrataFrame Developer (10K reputation)StrataFrame Developer (10K reputation)StrataFrame Developer (10K reputation)StrataFrame Developer (10K reputation)
Group: StrataFrame Developers
Posts: 6.6K, Visits: 6.9K
Good answers, guys! Thanks!
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