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 : Nov 16th 2018).
Unfortunately, activation email could not send to your email. Please try again.
Syncfusion Feedback

Cell type as RadioButton: Please do reply

Thread ID:

Created:

Updated:

Platform:

Replies:

27443 Apr 12,2005 09:16 PM UTC Apr 13,2005 01:22 AM UTC WinForms 3
loading
Tags: GridControl
Anu
Asked On April 12, 2005 09:16 PM UTC

HI, I am trying to understand the radioButtonCell sample. Q#1 Can I have all the cells of a column as radio button type? Q#2 Using what property or where do we specify the number of radio buttons for a cell, because a cell my hold any number of different vales? When I run the sample it is working for first two cells in 2nd column. But when I set the cell type as ‘radiobutton’ for some other cell it doesn’t show up. Please do help. I would really appreciate if you could reply soon. Thanks

Administrator [Syncfusion]
Replied On April 12, 2005 10:01 PM UTC

>HI, > >I am trying to understand the radioButtonCell sample. > >Q#1 >Can I have all the cells of a column as radio button type? > Set the column style (in grid.ColStyles) to have a CellType = "RadioButton". Unless all columns have the same radio buttons, you''ll need to set a different ChoiceList for each one. CellValue sets which radio button is currently checked. >Q#2 >Using what property or where do we specify the number of radio buttons for a cell, because a cell my hold any number of different vales? > The ChoiceList member of the Style contains the list of radio buttons as per the RadioButton sample in MainForm.cs around lines 67-72. >When I run the sample it is working for first two cells in 2nd column. But when I set the cell type as ‘radiobutton’ for some other cell it doesn’t show up. > Can you provide sample code that isn''t working? I''ve had no problem setting any cell to contain radio buttons. Pete

Anu
Replied On April 12, 2005 11:42 PM UTC

Thanks Pete, >Can you provide sample code that isn''t working? >I''ve had no problem setting any cell to contain >radio buttons. When you run that sample and pick any cell try to set the cell type at the run time within sample itself. it doesn’t show the radiobuttos. Probably because there is no way you can define ChoiceList at the run time that is why i don''t see. I may be wrong. thanks & regrads > > >>HI, >> >>I am trying to understand the radioButtonCell sample. >> >>Q#1 >>Can I have all the cells of a column as radio button type? >> > >Set the column style (in grid.ColStyles) to have a CellType = "RadioButton". Unless all columns have the same radio buttons, you''ll need to set a different ChoiceList for each one. CellValue sets which radio button is currently checked. > > >>Q#2 >>Using what property or where do we specify the number of radio buttons for a cell, because a cell my hold any number of different vales? >> > >The ChoiceList member of the Style contains the list of radio buttons as per the RadioButton sample in MainForm.cs around lines 67-72. > >>When I run the sample it is working for first two cells in 2nd column. But when I set the cell type as ‘radiobutton’ for some other cell it doesn’t show up. >> > >Can you provide sample code that isn''t working? I''ve had no problem setting any cell to contain radio buttons. > >Pete

Administrator [Syncfusion]
Replied On April 13, 2005 01:22 AM UTC

You can set the ChoiceList at runtime in that sample.
private void Form1_Load(object sender, System.EventArgs e)
{
	this.gridControl1[1,1].CellType = "RadioButton";
	StringCollection sc = new StringCollection();
	sc.AddRange(new string[]{"one", "two"});
	this.gridControl1[1,1].ChoiceList = sc;
}


In a GridDataBoundGrid, you cannot set any single cell style properties (except CellValue/Text). Instead, you woul dhandle grid.Model.QueryCellInfo, and if e.RowIndex and e.COlIndex point to your cell, then set e.Style.ChoiceList to the list you want to see in the radionButton cell, and set e.Style.CelType="RadioButton".

 

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

;