This is a migrated thread and some comments may be shown as answers.

Need Custom Column With List of Images

1 Answer 48 Views
GridView
This is a migrated thread and some comments may be shown as answers.
Brajendra
Top achievements
Rank 1
Brajendra asked on 05 Oct 2017, 01:02 PM

Hi,

I'm working on a project where I need to display data in Telerik RadGridView.

One of the column is going to display icons (can be multiple, displayed horizontally). These icons will be provided from .resx file of the project.

I was exploring custom column, tried creating custom column with RadPanelElement assuming that I'll be able to add picturebox windows control to the RadPanelElement object like

protected override void SetContentCore(object value)
        {
            if (this.Value != null && this.Value != DBNull.Value)
            {
                //this.radProgressBarElement.Value1 = Convert.ToInt16(this.Value);
                //this.radImageList
                foreach(string strImgIndex in this.Value.ToString().Split(','))
                {
                    PictureBox pbIcon = new PictureBox();
                    switch (int.Parse(strImgIndex))
                    {
                        case 0:
                            pbIcon.Image = WindowsFormsApplication1.Properties.Resources.binoculars;
                            break;

                        case 1:
                            pbIcon.Image = WindowsFormsApplication1.Properties.Resources.open;
                            break;

                        case 2:
                            pbIcon.Image = WindowsFormsApplication1.Properties.Resources.printer;
                            break;
                    }

                    //this.radImageList.Controls.Add (NOT ABLE TO ADD CONTROLS DYNAMICALLY)
                    //pbIcon.Image = Image.
                }
            }

It didn't work as not able to add controls to RadPanelElement. Please provide a way out to achieve the required custom column.

Thanks & Regards

Brajendra Singh

 

1 Answer, 1 is accepted

Sort by
0
Lance | Manager Technical Support
Telerik team
answered on 05 Oct 2017, 11:00 PM
Hi,

You've accidentally submitted this post under DataGrid for UI for UWP (Universal Windows Platform), not UI for Winforms. I have updated the topic for you so that it will be in the correct product forums.

Regards,
Lance | Tech Support Engineer, Sr.
Progress Telerik
Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Feedback Portal and vote to affect the priority of the items
Tags
GridView
Asked by
Brajendra
Top achievements
Rank 1
Answers by
Lance | Manager Technical Support
Telerik team
Share this question
or