Type | Description | |||
RadioGroup as Long | A long expression that indicates the identifier of the radio group. | |||
Index as Long | A long value that indicates the index of the item that contains the checked cell. | |||
ColIndex as Long | A long value that indicates the index of the column that contains the checked cell. |
A radio group contains a set of cells of radio types. Use the CellHasRadioButton property to set the cell of radio type. To change the state for a cell you can use the CellState property. To add or remove a cell to a given radio group you have to use CellHasRadioButton property. Use the CellRadioGroup property to add cells in the same radio group. The control fires the CellStateChanged event when the check box or radio button state is changed.
The following VB sample groups the radio cells in the first column, and displays the caption of the checked radio cell:
With List1 .Columns(0).Def(exCellHasRadioButton) = True For Each i In .Items .Items.CellRadioGroup(i, 0) = 1234 Next End With
The following C++ sample groups the radio cells on the first column, and displays the caption of the checked radio cell:
#include "Items.h" COleVariant vtColumn( long(0) ); CItems items = m_list.GetItems(); m_list.BeginUpdate(); for ( long i = 0; i < items.GetCount(); i++ ) { items.SetCellHasRadioButton( i, vtColumn, TRUE ); items.SetCellRadioGroup( i, vtColumn, 1234 ); } m_list.EndUpdate();
The following VB.NET sample groups the radio cells on the first column, and displays the caption of the checked radio cell:
With AxList1 .BeginUpdate() .Columns(0).Def(EXLISTLib.DefColumnEnum.exCellHasRadioButton) = True With .Items Dim k As Integer For k = 0 To .Count - 1 .CellRadioGroup(k, 0) = 1234 Next End With .EndUpdate() End With
The following C# sample groups the radio cells on the first column, and displays the caption of the checked radio cell:
axList1.BeginUpdate(); EXLISTLib.Items items = axList1.Items; axList1.Columns[0].set_Def(EXLISTLib.DefColumnEnum.exCellHasRadioButton, true); for (int i = 0; i < items.Count; i++) items.set_CellRadioGroup(i, 0, 1234); axList1.EndUpdate();
The following VFP sample groups the radio cells on the first column, and displays the caption of the checked radio cell:
thisform.List1.BeginUpdate() with thisform.List1.Items local i for i = 0 to .Count - 1 .CellHasRadioButton( i,0 ) = .t. .CellRadioGroup(i,0) = 1234 next endwith thisform.List1.EndUpdate()