Image column

8 posts, 1 answers
  1. Joaquín
    Joaquín avatar
    27 posts
    Member since:
    Jan 2012

    Posted 29 Dec 2012 Link to this post

    Is there a way to create a ListView in which one of the columns is an image column (this is, a column in which to show an image)?. I would like also to be able to turn the visibility of the images on and off. Thank you!

    Joaquín
  2. Answer
    Anton
    Admin
    Anton avatar
    167 posts

    Posted 03 Jan 2013 Link to this post

    Hello Joaquín,

    Thank you for writing.

    Although it can be achieved, such a functionality is not supported out of the box from RadListView. I would suggest you to use RadGridView instead of RadListView, where this functionality is implemented and will be much easier to achieve such behavior - simply use a GridViewImageColumn and CellFormatting event of the grid. Let me know if this approach is not suitable for you.

    Attached is a sample project.

    Should you have any other questions, I will be glad to assist you.

    Kind regards,
    Anton
    the Telerik team
    Q3'12 SP1 of RadControls for WinForms is out now. See what's new.
  3. UI for WinForms is Visual Studio 2017 Ready
  4. Joaquín
    Joaquín avatar
    27 posts
    Member since:
    Jan 2012

    Posted 03 Jan 2013 Link to this post

    Hi Anton,

    Thank you for your reply. I'm used to the ASP.NET version of the ListView control and thought I could create an item template in WinForms as I do in ASP.NET. I will try using RadGrid in WinForms as you suggest.

    Joaquín
  5. Anton
    Admin
    Anton avatar
    167 posts

    Posted 07 Jan 2013 Link to this post

    Hi Joaquín,

    Thank you for writing back.

    Unfortunately, in WinForms there is no direct equivalent of the templates in ASP.Net. However the desired behavior can be achieved with the RadGridView.

    Should you have any other questions, I will be glad to assist you.

    Greetings,
    Anton
    the Telerik team
    Q3'12 SP1 of RadControls for WinForms is out now. See what's new.
  6. Patrick
    Patrick avatar
    7 posts
    Member since:
    Jul 2011

    Posted 05 Aug 2013 Link to this post

    Hello,
    I attempted to use the demo project included in your reply.  I'm using VS 2012 and 2013 Q2 of the Telerik RadControls (2013.2.724.40).

    When I attempt to view Form1 in the designer, it does not display but instead it shows a "To prevent possible data loss before loading the designer, the following errors must be resolved" page with two errors. the first is:

    "Object reference not set to an instance of an object" with a call stack of:
    at Telerik.WinControls.UI.Design.RadGridViewDesigner.Initialize(IComponent component)
    at System.ComponentModel.Design.DesignerHost.AddToContainerPostProcess(IComponent component, String name, IContainer containerToAddTo)
    at System.ComponentModel.Design.DesignerHost.PerformAdd(IComponent component, String name)
    at System.ComponentModel.Design.DesignerHost.System.ComponentModel.Design.IDesignerHost.CreateComponent(Type componentType, String name)
    at System.ComponentModel.Design.Serialization.DesignerSerializationManager.CreateInstance(Type type, ICollection arguments, String name, Boolean addToContainer)
    at System.ComponentModel.Design.Serialization.DesignerSerializationManager.System.ComponentModel.Design.Serialization.IDesignerSerializationManager.CreateInstance(Type type, ICollection arguments, String name, Boolean addToContainer)
    at System.ComponentModel.Design.Serialization.CodeDomSerializerBase.DeserializeInstance(IDesignerSerializationManager manager, Type type, Object[] parameters, String name, Boolean addToContainer)
    at Telerik.WinControls.UI.Design.RadControlCodeDomSerializer.DeserializeInstance(IDesignerSerializationManager manager, Type type, Object[] parameters, String name, Boolean addToContainer)
    at System.ComponentModel.Design.Serialization.CodeDomSerializerBase.DeserializeExpression(IDesignerSerializationManager manager, String name, CodeExpression expression)
    at System.ComponentModel.Design.Serialization.CodeDomSerializer.DeserializeStatementToInstance(IDesignerSerializationManager manager, CodeStatement statement)
    at Telerik.WinControls.UI.Design.RadControlCodeDomSerializer.Deserialize(IDesignerSerializationManager manager, Object codeObject)
    at System.ComponentModel.Design.Serialization.TypeCodeDomSerializer.DeserializeName(IDesignerSerializationManager manager, String name, CodeStatementCollection statements)

    The second error:
    "The variable 'radGridView1' is either undeclared or was never assigned."
    I think this appears to happen because of the first since it clearly is declared in the designer cs:
    private Telerik.WinControls.UI.RadGridView radGridView1;
    
    and instantiated:
    this.radGridView1 = new Telerik.WinControls.UI.RadGridView();
    

    I appreciate any guidance in resolving this.
    Patrick
  7. Anton
    Admin
    Anton avatar
    167 posts

    Posted 08 Aug 2013 Link to this post

    Hi Patrick,

    Thank you for writing.

    In order to resolve the issue, please follow these steps:

    1. Ensure that the demo project has all required references
    • Telerik.WinControls.dll
    • Telerik.WinControls.GridView.dll
    • Telerik.WinControls.UI.dll
    • Telerik.WinControls.UI.Design.dll
    • TelerikCommon.dll
    2. Execute Clean and Rebuild commands.
    3. If the steps above do not help, you should restart the Visual Studio.

    I hope this helps.

    Regards,
    Anton
    Telerik
    TRY TELERIK'S NEWEST PRODUCT - EQATEC APPLICATION ANALYTICS for WINFORMS.
    Learn what features your users use (or don't use) in your application. Know your audience. Target it better. Develop wisely.
    Sign up for Free application insights >>
  8. Patrick
    Patrick avatar
    7 posts
    Member since:
    Jul 2011

    Posted 08 Aug 2013 Link to this post

    Thank you for the reply.  I had confirmed the references before. The odd thing was  it compiled and ran w/out error; I simply could not open the form in design view.  Cleaning, rebuilding the project and restarting VS resolved the problem.  Thank you.

    Patrick
  9. Anton
    Admin
    Anton avatar
    167 posts

    Posted 09 Aug 2013 Link to this post

    Hello Patrick,

    Thank you for writing back.

    I am glad to hear that the issue is already resolved. Let me know if you have any additional questions.

    Regards,
    Anton
    Telerik
    TRY TELERIK'S NEWEST PRODUCT - EQATEC APPLICATION ANALYTICS for WINFORMS.
    Learn what features your users use (or don't use) in your application. Know your audience. Target it better. Develop wisely.
    Sign up for Free application insights >>
Back to Top
UI for WinForms is Visual Studio 2017 Ready