[Last Call] Learn about multicloud storage options and how to improve your company's cloud strategy. Register Now

x
?
Solved

RepositoryItemPictureEdit in DevExpress LayoutView - Assigning Image from url

Posted on 2010-11-23
10
Medium Priority
?
5,625 Views
Last Modified: 2012-05-10
Hi, (Question Value 500)
I have been struggling from past 5 hours to populate the image from the database, where database have a url (text) from where image has to be loaded.

I am using Devexpress Winforms 9, and doing this in Layoutview repositoryitempictureedit.

Non of the given event is working so that I may intercept the loading and pass the image based on path given in database.

Please help me out if someone here using Devexpress controls.

Jay Khatri
0
Comment
Question by:jaykhatri
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 5
  • 4
10 Comments
 
LVL 10

Expert Comment

by:thefritterfatboy
ID: 34203413
I'm not very familiar with DevExpress but my understanding is this;

You need to handle the DataBound / ItemDataBound event for the LayoutView. In that event, you need to call the FindControl() method on the LayoutView control to get your RepositoryItemPictureEdit control. Next, you need to get the data for the item being bound - this will give you the URL (text) for your image. You then need to load this image in your code and set it to the Image property of your RepositoryItemPictureEdit control.

I don't think there is a simpler way to do this unless you store the image itself in the database as binary data and simply bind it to the RepositoryItemPictureEdit control.
0
 
LVL 83

Expert Comment

by:CodeCruiser
ID: 34203993
0
 

Author Comment

by:jaykhatri
ID: 34206589
Actually the event LayoutView1_CustomUnboundColumnData is not getting fired, first I thought it might be the problem that I have not used any unbound column, then I removed the columns from designer and specified like that:


        Dim ds As New DataSet
        str = "select * from scandocs scandocsreg where reg_id=" & Pubreg_id
        ds = clscmn.Fill_DS(str)
        LayoutView1.GridControl = GCdocs

        LayoutView1.OptionsBehavior.AutoPopulateColumns = False
        GCdocs.DataSource = ds.Tables(0)

        Dim colscandocid As DevExpress.XtraGrid.Columns.LayoutViewColumn = LayoutView1.Columns.AddField("scandocid")
        Dim colscancaption As DevExpress.XtraGrid.Columns.LayoutViewColumn = LayoutView1.Columns.AddField("LastName")
        Dim colscanurl As DevExpress.XtraGrid.Columns.LayoutViewColumn = LayoutView1.Columns.AddField("Address")
        ' Access corresponding card fields.
        Dim fieldscandocid As DevExpress.XtraGrid.Views.Layout.LayoutViewField = colscandocid.LayoutViewField
        Dim fieldscancaption As DevExpress.XtraGrid.Views.Layout.LayoutViewField = colscancaption.LayoutViewField
        Dim fieldscanurl As DevExpress.XtraGrid.Views.Layout.LayoutViewField = colscanurl.LayoutViewField

        ' Assign editors to card fields.
        Dim riPictureEdit As DevExpress.XtraEditors.Repository.RepositoryItemPictureEdit = GCdocs.RepositoryItems.Add("PictureEdit")
        colscanurl.ColumnEdit = riPictureEdit

this is the snippet of load event.

Please help me out if someone is using as I am completely puzzled with this.
0
Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 
LVL 83

Assisted Solution

by:CodeCruiser
CodeCruiser earned 2000 total points
ID: 34206696
You can download the attached project from the article and examine its source code.
0
 

Author Comment

by:jaykhatri
ID: 34206781
The source code is not compatible with my environment, I think difference in dll and even IDE is not enabling to compile it.
0
 
LVL 83

Accepted Solution

by:
CodeCruiser earned 2000 total points
ID: 34206849
Use the
DevExpress program group ->Components ->Tools ->Project Converter

tool to upgrade it.
0
 

Author Comment

by:jaykhatri
ID: 34207715
I checked all the parameters but still I am unbale to get the event fired gridView1_CustomUnboundColumnData(ByVal sender As Object, ByVal e As DevExpress.XtraGrid.Views.Base.CustomColumnDataEventArgs) Handles LayoutView1.CustomUnboundColumnData

found only the difference i.e. the vb form include the designer data and I my case a designer file is different lke myfle.designer.vb

and my data is initializing in form_load event.
0
 
LVL 83

Expert Comment

by:CodeCruiser
ID: 34211689
How did you add the unbound column to the grid? Using the Designer?
0
 

Author Comment

by:jaykhatri
ID: 34211818
Ye using designer with fake datafield
0
 
LVL 83

Expert Comment

by:CodeCruiser
ID: 34211927
All I can say now is that you keep experimenting and trial and error witht he project. Try to match the settings with those in the sample project etc.
0

Featured Post

VIDEO: THE CONCERTO CLOUD FOR HEALTHCARE

Modern healthcare requires a modern cloud. View this brief video to understand how the Concerto Cloud for Healthcare can help your organization.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

This tutorial demonstrates one way to create an application that runs without any Forms but still has a GUI presence via an Icon in the System Tray. The magic lies in Inheriting from the ApplicationContext Class and passing that to Application.Ru…
Introduction As chip makers focus on adding processor cores over increasing clock speed, developers need to utilize the features of modern CPUs.  One of the ways we can do this is by implementing parallel algorithms in our software.   One recent…
Visualize your data even better in Access queries. Given a date and a value, this lesson shows how to compare that value with the previous value, calculate the difference, and display a circle if the value is the same, an up triangle if it increased…
In response to a need for security and privacy, and to continue fostering an environment members can turn to for support, solutions, and education, Experts Exchange has created anonymous question capabilities. This new feature is available to our Pr…

650 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question