We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy. (Last updated on: November 16, 2018).
Unfortunately, activation email could not send to your email. Please try again.
Syncfusion Feedback

Displaying Images in GridListControl Columns

Thread ID:

Created:

Updated:

Platform:

Replies:

45611 Jun 25,2006 08:51 PM UTC Jun 30,2006 03:08 AM UTC WinForms 9
loading
Tags: GridControl
Dave
Asked On June 25, 2006 08:51 PM UTC

Hello, I can display an Image in my GridListControl by setting the "ImageColumn" and "ImageList" properties, but how can I display an image in more than one column? For example, I need to display a GridListControl with three columns; an Image, some text data, and then another image. How can I do this? Thanks... Dave

Administrator [Syncfusion]
Replied On June 26, 2006 04:01 PM UTC

Hi Dave, This can be achieved by handling the PrepareViewStyleInfo event of the GridListControl and assigning the respective imagelist. The following sample demonstrates this process. Sample : GridListControl_Image_Multicolumn Thanks and regards, Madhan

Dave
Replied On June 27, 2006 04:53 PM UTC

Hello - This ZIP file contains no files....please help. Thanks. Dave >Hello, > >I can display an Image in my GridListControl by setting the "ImageColumn" and "ImageList" properties, but how can I display an image in more than one column? For example, I need to display a GridListControl with three columns; an Image, some text data, and then another image. How can I do this? > >Thanks... >Dave

Dave
Replied On June 27, 2006 04:55 PM UTC

Madhan, This ZIP file contains no files....please help. Thanks. Dave >Hi Dave, > >This can be achieved by handling the PrepareViewStyleInfo event of the GridListControl and assigning the respective imagelist. The following sample demonstrates this process. > >Sample : GridListControl_Image_Multicolumn > >Thanks and regards, >Madhan >

Administrator [Syncfusion]
Replied On June 27, 2006 05:22 PM UTC

Hi Dave, Sorry for the inconvenience. Here is the link for the sample. http://www.syncfusion.com/Support/user/uploads/GridListControl_Image_Multicolumn_4bcde661.zip Thanks, Madhan

Dave
Replied On June 28, 2006 11:55 PM UTC

Thanks Madhan, that works great. One last question - is there any reason why a DataTable has to be used for the GridListControl ''DataSource'' property? Is there any way an ArrayList could be used in your example? Thanks again. Dave >Hi Dave, > >Sorry for the inconvenience. Here is the link for the sample. > >http://www.syncfusion.com/Support/user/uploads/GridListControl_Image_Multicolumn_4bcde661.zip > >Thanks, >Madhan >

Administrator [Syncfusion]
Replied On June 29, 2006 12:22 AM UTC

Hi Dave, You can have datasource as ArrayList as similar to a datatable. Kindly refer to the following code snippet for details. +++++++++++++++++++++++++++++++++++++++ public class Form1 : System.Windows.Forms.Form { =========== ========== private void Form1_Load(object sender, System.EventArgs e) { =========== ========== this.gridListControl1.DataSource = GetArrayList();//GetParentTable(); this.gridListControl1.DisplayMember = "ID"; this.gridListControl1.ValueMember = "ID"; this.gridListControl1.MultiColumn = true; } private ArrayList GetArrayList() { ArrayList array = new ArrayList(); array.Add(new MyArrayClass(null,"Name1",null)); ===== ==== return array; } } public class MyArrayClass { private string id, name, address; public MyArrayClass(string id,string name,string address) { this.id = id; this.name = name; this.address = address; } public string ID { get { return id; } set { id = value; } } ==== ====== } +++++++++++++++++++++++++++++++++++++++ Best regards, Madhan

Dave
Replied On June 30, 2006 12:30 AM UTC

Hi again Madhan, Your example is kind of working for me - my question is, by setting the ''DisplayMember'' to the "ID" of that class, what does that do? Also, how do you know which fields within a class are going to display in the GridList? I still am trying to get ONLY four fields from my class to display in four columns: Id, ICON, Name, ICON2. The problem seems to be that I have several data members/fields in my (display) object, and others are getting populated in the columns. Thanks again, Dave Busch >Hi Dave, > >You can have datasource as ArrayList as similar to a datatable. Kindly refer to the following code snippet for details. > >+++++++++++++++++++++++++++++++++++++++ >public class Form1 : System.Windows.Forms.Form >{ >=========== >========== >private void Form1_Load(object sender, System.EventArgs e) >{ >=========== >========== > this.gridListControl1.DataSource = GetArrayList();//GetParentTable(); > this.gridListControl1.DisplayMember = "ID"; > this.gridListControl1.ValueMember = "ID"; > this.gridListControl1.MultiColumn = true; >} >private ArrayList GetArrayList() >{ > ArrayList array = new ArrayList(); > array.Add(new MyArrayClass(null,"Name1",null)); >===== >==== > return array; >} >} > >public class MyArrayClass >{ >private string id, name, address; >public MyArrayClass(string id,string name,string address) >{ > this.id = id; > this.name = name; > this.address = address; >} >public string ID >{ > get > { > return id; > } > set > { > id = value; > } >} >==== >====== >} >+++++++++++++++++++++++++++++++++++++++ > >Best regards, >Madhan >

Administrator [Syncfusion]
Replied On June 30, 2006 01:42 AM UTC

Hi Dave, The Display and Value member will be helpful in displaying and retrieving the required column values, when we have the gridListControl as a dropdown in the grid. In this case, you can cancel it. The grid will display as in the datasource, so to display the required columns you can hide the unnecessary columns in the grid. Sample : http://www.syncfusion.com/Support/user/uploads/GridListControl_Image_Multicolumn_63b4d1b7.zip Best regards, Madhan

Dave
Replied On June 30, 2006 03:08 AM UTC

Thanks for all of your prompt responses! I''ll take a look at your example :) >Hi Dave, > >The Display and Value member will be helpful in displaying and retrieving the required column values, when we have the gridListControl as a dropdown in the grid. In this case, you can cancel it. The grid will display as in the datasource, so to display the required columns you can hide the unnecessary columns in the grid. > >Sample : http://www.syncfusion.com/Support/user/uploads/GridListControl_Image_Multicolumn_63b4d1b7.zip > >Best regards, >Madhan

CONFIRMATION

This post will be permanently deleted. Are you sure you want to continue?

Sorry, An error occured while processing your request. Please try again later.

Warning Icon You are using an outdated version of Internet Explorer that may not display all features of this and other websites. Upgrade to Internet Explorer 8 or newer for a better experience.Close Icon

;