Quantcast
Channel: Telerik Forums RSS
Viewing all articles
Browse latest Browse all 84751

RadBinaryImage databound within RadImageGallery

$
0
0

Thank you for the reply. I tried it again, just in case I missed something. Still no luck. Attached is a screenshot of the UI, it is pulling the correct count (3), but not the image via binary. Here is the code, just in case I missed something, wouldn't be the first time :)

BTW: what is the trick to post code in this forum, seems copy and paste is not as legible as it could be?

 

        <telerik:RadImageGallery ID="PresentationView_RadImageGallery" Height="100%" runat="server" DataImageField="FullContent" OnNeedDataSource="PresentationView_RadImageGallery_NeedDataSource">
            <ClientSettings>
                <ClientEvents OnImageGalleryCreated="onImageGalleryCreated" />
            </ClientSettings>
        </telerik:RadImageGallery>

 

        protected void PresentationView_RadImageGallery_NeedDataSource(object sender, ImageGalleryNeedDataSourceEventArgs e) {
            PresentationView_RadImageGallery.DataSource = GetPresentationSlideList();
        }

 

public DataTable GetPresentationSlideList() {
            DataTable data = new DataTable();
            data.Columns.Add("ID", typeof(int));
            data.Columns.Add("Company");
            data.Columns.Add("Presentation");
            data.Columns.Add("Description");
            data.Columns.Add("FullContent");
            data.Columns.Add("ThumbnailContent");
            data.Columns.Add("SlideOrder");
            data.Columns.Add("VersionId", typeof(int));
            data.PrimaryKey = new DataColumn[] { data.Columns["ID"] };
            
            IncludeFieldsList includeFieldList = new IncludeFieldsList();
            includeFieldList.Add(SlideFields.Id);
            includeFieldList.Add(SlideFields.CompanyId);
            includeFieldList.Add(SlideFields.Description);
            includeFieldList.Add(SlideFields.FullContent);
            includeFieldList.Add(SlideFields.ThumbnailContent);
            includeFieldList.Add(PresentationSlideFields.SlideOrder);
            includeFieldList.Add(PresentationSlideFields.VersionId);
            PresentationSlideCollection presentationSlideCollection = new PresentationSlideCollection();
            var relations = new RelationCollection(PresentationSlideEntity.Relations.PresentationEntityUsingPresentationId);
            relations.Add(PresentationSlideEntity.Relations.SlideEntityUsingSlideId);
            var filter = new PredicateExpression(PresentationFields.CompanyId == CompanyId);
            filter.Add(PresentationSlideFields.PresentationId == PresentationId);
            filter.Add(PresentationSlideFields.VersionId == UtilityFunctions.getMaxVersionId(PresentationId));
            presentationSlideCollection.GetMulti(filter, -1, null, relations, null, includeFieldList, -1, -1);
            foreach (PresentationSlideEntity presentationSlideEntity in presentationSlideCollection.OrderBy(P => P.SlideOrder)) {
                data.Rows.Add(
                    presentationSlideEntity.Slide.Id,
                    presentationSlideEntity.Slide.Company.Name,
                    presentationSlideEntity.Slide.Description,
                    presentationSlideEntity.Slide.FullContent,
                    presentationSlideEntity.Slide.ThumbnailContent,
                    presentationSlideEntity.SlideOrder,
                    presentationSlideEntity.VersionId
                );
            }

            return data;
        }

 

In the DB: FullContent is varbinary(MAX)


Viewing all articles
Browse latest Browse all 84751

Latest Images

Trending Articles



Latest Images

<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>