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

Radiobutton in grid

Thread ID:





90454 Oct 1,2009 10:57 PM UTC Oct 8,2009 11:01 AM UTC WinForms 6
Tags: GridControl
Vivek Thirumalai
Asked On October 1, 2009 10:57 PM UTC

I have radiobutton as one of the cells in the grid. But I have alignment problems. Please look at the attached image. I want to bring the two options closer. Is there a way to achieve it?

Thanks in advance!


Vivek Thirumalai
Replied On October 1, 2009 11:05 PM UTC

Also is there a way to specify the value of the radiobutton options?

Lingaraj S [Syncfusion]
Replied On October 2, 2009 01:50 PM UTC

Hi Vivek,

Thank you for your interest in Syncfusion products.

Please try overriding the OnLayout method in CustomRadioCellRenderer to reduce the distance between RadioButtons as shown in below sample:

Please let me know if you have any queries.

Lingaraj S.

Vivek Thirumalai
Replied On October 5, 2009 10:53 PM UTC

Hi Lingaraj,

Thanks for the example. About my second question, if the choicelist is :

sc.AddRange(new String[]{ "radio 0", "radio 1"});

when radio 0 is selected the value is 0, but can the value be different. Basically I want this to be other way, meaning my I want to display radio 1 before radio 0:

sc.AddRange(new String[]{ "radio 1", "radio 0"});

and I want the value to be the same i.e., when radio 1 is selected the value needs to be 1. Is this possible? I can do it programmatically, but want to see if this doable via choicelist.


Jisha Joy [Syncfusion]
Replied On October 6, 2009 11:47 AM UTC

Hi Vivek,

You could try handling the CellButtonClicked event and let me know if this helps.

void gridControl1_CellButtonClicked(object sender, GridCellButtonClickedEventArgs e)
GridCurrentCell cc = this.gridControl1.CurrentCell;

if (this.gridControl1[cc.RowIndex, cc.ColIndex].CellValue.Equals(0))
this.gridControl1[cc.RowIndex, cc.ColIndex].CellValue = 1;
else if (this.gridControl1[cc.RowIndex, cc.ColIndex].CellValue.Equals(1))
this.gridControl1[cc.RowIndex, cc.ColIndex].CellValue = 0;



Vivek Thirumalai
Replied On October 7, 2009 02:07 PM UTC

That would not work as the underlying data is changed as well.

Jisha Joy [Syncfusion]
Replied On October 8, 2009 11:01 AM UTC

Hi Vivek,

There is no property setting available to alter the behavior.The cellvalue for the first button will return 0 and cell value of the second button will return 1.

Please let me know if you have any questions.



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

This page will automatically be redirected to the 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