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

How to add Range Slider in grid control?

Thread ID:





105625 Nov 6,2012 01:49 PM UTC Nov 9,2012 12:23 PM UTC WinForms 5
Tags: GridControl
Neeraj Kumar
Asked On November 6, 2012 01:49 PM UTC


I am trying to add Range slider into grid cell like Trackbar but rendering is not happing properly and I don't know how to remember the slider min & max values and range slider cell back color is always coming black. Please help me to resolve this problem.

Please find sample from the attachment.


Athiram S [Syncfusion]
Replied On November 8, 2012 10:13 AM UTC

Hi Neeraj,

Thank you for your interest in Syncfusion Products.

It is possible to the set the minimum and maximum value using Minimum and Maximum property. The current trackbar value can be retrived using Value  property. Please refer the folllowing code snippet:

this.trackBar1.Minimum = 3;
this.trackBar1.Maximum = 15;
this.trackBar1.TickFrequency = 3;
this.label1.Text = this.trackBar1.Value.ToString();

Please let me know if any concerns.

Athiram S

Neeraj Kumar
Replied On November 8, 2012 10:18 AM UTC


Trackbar is working properly , i want to add range slider (Trackbar with 2 sliders) as custom cell. Please check the attached project , rendering is not happening properly and i don't know how remember the SiderMin and SliderMax property in custom cell.

Athiram S [Syncfusion]
Replied On November 9, 2012 10:28 AM UTC

Hi Neeraj,

Thanks for the interst in Syncfusion products.

You can set slider control in your grid with the help of following code.

gridControl1.CellModels.Add("Slider", new SliderCellModel(gridControl1.Model));
            gridControl1[2, 2].CellType = "Slider";
            GridStyleInfo style;
            SliderStyleProperties sp;
            style = gridControl1[2,2];
            sp = new SliderStyleProperties(style);
            int max = (sp.Maximum = 10);
            int min = (sp.Minimum = 1);
            gridControl1[2,1].Text = min.ToString();
            gridControl1[2, 3].Text = max.ToString();

And you can get the value of the Slider, handling CurrentCellChanged event as follows.

    private void gridControl1_CurrentCellChanged(object sender, EventArgs e)
            string s;
            GridCurrentCell cc = gridControl1.CurrentCell;
            GridCellRendererBase renderer = cc.Renderer;
            if (cc.RowIndex == 2 & cc.ColIndex==2)
                s = renderer.ControlValue.ToString();
                Console.WriteLine("Slider Value --> " + s);
                gridControl1[1, 2].Text = s;

Please refer the sample in the below link that illustrates the above.


Please let me know if you have any questions.

Athiram S

Neeraj Kumar
Replied On November 9, 2012 10:47 AM UTC


Thank you for your reply.

Unfortunately the given link is not loading for me?.Please can you check it.

Athiram S [Syncfusion]
Replied On November 9, 2012 12:23 PM UTC

Hi Neeraj,

Sorry for the inconvenience.

Please make use of following links for your reference:


Please let me know if you have any concerns.

Athiram S


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.

Please sign in to access our forum

or the page will be automatically redirected to sign-in page in 10 seconds.

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