how to get records and images and display on page which are saved by module bulider - Front- & Back-End Development - Front- & Back-End Development - Progress Community
 Front- & Back-End Development

how to get records and images and display on page which are saved by module bulider

  • how to get records and images and display on page which are saved by module bulider
  • HI.
    i have one case  where i created one module with  siteinfinity  4.4 and save some records and stroe images .
    i am able  display the  records using following code
    But how i will  display  image . or how i get  image url
    <%@ Control Language="C#" AutoEventWireup="true" CodeBehind="DisplayItems.ascx.cs" Inherits="SitefinityWebApp.DisplayItems" %>
    <%@ Register TagPrefix="telerik" Namespace="Telerik.Web.UI" Assembly="Telerik.Web.UI" %>
    <!-- ScriptManager or RadScriptManager is required by RadGrid, but this tag probably already exists on the Master Template -->
    <!-- <telerik:RadScriptManager ID="RadScriptManager1" runat="server" /> -->
    <telerik:radgrid id="Grid" runat="server" autogeneratecolumns="False">
                <telerik:gridboundcolumn datafield="Title" headertext="Title">
    // ~/DisplayItems.ascx.cs
    using System;
    using System.Linq;
    using System.Collections.Generic;
    using Telerik.Sitefinity.Model;
    using Telerik.Sitefinity.DynamicModules;
    using Telerik.Sitefinity.Data.Linq.Dynamic;
    using Telerik.Sitefinity.DynamicModules.Model;
    using Telerik.Sitefinity.Utilities.TypeConverters;
    using Telerik.Sitefinity.GenericContent.Model;
    namespace SitefinityWebApp
        public partial class DisplayItems : System.Web.UI.UserControl
            protected void Page_Load(object sender, EventArgs e)
                DynamicModuleManager dynamicModuleManager = DynamicModuleManager.GetManager();
                Type profileManagerType = TypeResolutionService.ResolveType("Telerik.Sitefinity.DynamicTypes.Model.ProfileManager.ProfileManager");
                // Fetch a collection of "live" and "visible" Person items.
                var myCollection = dynamicModuleManager.GetDataItems(profileManagerType).Where(i => i.Status == ContentLifecycleStatus.Live && i.Visible == true);
                // Binds the collection of Person items to the RadGrid
                Grid.DataSource = myCollection;
  • Hello,

     Get the module item or items and then call GetValue() you will need to add
    using Telerik.Sitefinity.Model;

    var myFilteredCollection = dynamicModuleManager.GetDataItem(cupType, new Guid( ... guid here)).GetValue("image");
    //the image field is called "image" GetValue() gets the value of a field by its name

    Stanislav Velikov
    the Telerik team
    Do you want to have your say in the Sitefinity development roadmap? Do you want to know when a feature you requested is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items
  • how to get images from image gallery & bind it with Grid View?