how to get records and images and display on page which

Posted by Community Admin on 04-Aug-2018 14:51

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

All Replies

Posted by Community Admin on 14-Feb-2012 00:00

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">
    <mastertableview>
        <columns>
            <telerik:gridboundcolumn datafield="Title" headertext="Title">
        </telerik:gridboundcolumn></columns>
    </mastertableview>
</telerik:radgrid>
 
// ~/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;
            Grid.DataBind();
        
    
 
Thanks

Posted by Community Admin on 17-Feb-2012 00:00

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

Regards,
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

Posted by Community Admin on 06-Sep-2012 00:00

how to get images from image gallery & bind it with Grid View?

This thread is closed