StrataFrame Forum
Back
Login
Login
Home
»
StrataFrame Application Framework - V1
»
WinForms (How do I?)
»
Como carregar imagens no ListView
Como carregar imagens no ListView
Post Reply
Like
0
Como carregar imagens no ListView
View
Flat Ascending
Flat Descending
Threaded
Options
Subscribe to topic
Print This Topic
RSS Feed
Goto Topics Forum
Author
Message
Trent Taylor
Trent Taylor
posted 13 Years Ago
ANSWER
Post Details
Share Post
Group: StrataFrame Developers
Posts: 6.6K,
Visits: 6.9K
You can't have an explicit conversion in C# if you don't have the operator defined. In this example, the explicit conversion cannot happen between a BusinessLayer and your BO type. Just cast it:
MesasBo mesas;
mesas =
(MesasBo)
e.BusinessObject;
Also, don't create a new instance of mesas because you are pushing a reference to that variable. So you don't want to create an instance of it first, that will just cause a potential memory leak since you didn't dispose of the object. Though no handlers were created either, so it would most likely have cleaned itself up through the collector. But this is still not a good way to setup a variable that will have a reference pushed into it.
Reply
Like
0
Ivan George Borges
Ivan George Borges
posted 13 Years Ago
ANSWER
Post Details
Share Post
Group: StrataFrame MVPs
Posts: 1.9K,
Visits: 21K
Have a look at this post:
http://forum.strataframe.net/FindPost16905.aspx
Reply
Like
0
Marcio Valerio Silva
Marcio Valerio Silva
posted 13 Years Ago
ANSWER
Post Details
Share Post
Group: Forum Members
Posts: 55,
Visits: 929
Sorry but I Really need this information!
In the Documentation has this sample:
Private Sub ListView1_RowPopulating( _
ByVal e As MicroFour.StrataFrame.UI.Windows.Forms.RowPopulatingEventArgs) _
Handles ListView1.RowPopulating
'-- Establish locals
Dim loBO As CustomersBO
'-- Get the reference to the business object
loBO = e.BusinessObject
If loBO.cust_gender = 0 Then
'-- The customer is a male, set the background color to blue
' and set the image key to the boy icon
e.RowBackColor = Drawing.Color.LightBlue
e.ImageKey = "boy.ico"
Else
'-- The customer is a girl, set the background color to pink
' and set the image key to the girl icon
e.RowBackColor = Drawing.Color.Pink
e.ImageKey = "girl.ico"
End If
'-- The fourth column has been configured to PopulateThroughEvent
If loBO.cust_email.Length > 0 Then
'-- We have an email in the record
e.Values(3).DisplayValue = loBO.cust_email
Else
'-- We don't have an email for this customer
e.Values(3).DisplayValue = "unavailable"
End If
End Sub
and I translated to c#:
private void listView1_RowPopulating(MicroFour.StrataFrame.UI.Windows.Forms.RowPopulatingEventArgs e)
{
MesasBo mesas = new MesasBo();
mesas = e.BusinessObject;
}
and I get this error:
Error 10 Cannot implicitly convert type 'MicroFour.StrataFrame.Business.BusinessLayer' to 'M2BusinessObjectLibrary.MesasBo'. An explicit conversion exists (are you missing a cast?) D:\Projetos\Business Enterprise\M2FoodService\Form1.cs 65 24 M2FoodService
I need a quick solution for this problem.
at,
Marcio Valerio da Silva
Edited
13 Years Ago by
Marcio Valerio Silva
Reply
Like
0
Marcio Valerio Silva
Marcio Valerio Silva
posted 13 Years Ago
ANSWER
Topic Details
Share Topic
Group: Forum Members
Posts: 55,
Visits: 929
How Do I load images in the Strata Frame ListView Component?
I Tryed:
Private
void
listView1_RowPopulating(MicroFour.StrataFrame.UI.Windows.Forms.
RowPopulatingEventArgs
e)
{
MesasBo loBO = new MesasBo();
loBO = e.BusinessObject;
}
But in C# don´t work "loBO = e.BusinessObject" as the documentation method example in VB.
I somebody know how please answer my question.
thanks!
----------------------------------------------------------------------------------
Como carregar imgens no ListView do Strata Frame os dados já sei como fazer mas gostaria de carregar imagens definidas no cadastro.
Eu até tentei o exemplo da documentação conforme acima porém não funcionou no c#.
Se alguém souber como fazer responda-me por favor.
Obrigado!
at,
Marcio Valerio da Silva
Edited
13 Years Ago by
Marcio Valerio Silva
Reply
Like
0
GO
Merge Selected
Merge into selected topic...
Merge into merge target...
Merge into a specific topic ID...
Open Merge
Post Reply
Like
0
Similar Topics
Post Quoted Reply
Reading This Topic
Login
Login
Remember Me
Reset Password
Resend Validation Email
Login
Explore
Messages
Mentions
Search