<telerik:RadButton ID="btnToggle2" CausesValidation="false" runat="server" ToggleType="CheckBox" ButtonType="StandardButton" Skin="Forest"
AutoPostBack="False" >
<ToggleStates>
<telerik:RadButtonToggleState Text="Fax" Width="55px" />
<telerik:RadButtonToggleState Text="Email" Width="55px" />
<telerik:RadButtonToggleState Text="Both" Width="55px" />
</ToggleStates>
</telerik:RadButton>
<<here i'm assigning the text to the correct indexed button>>
If
Not IsDBNull(dt.Rows(0).Item("ZZ_ACH_VIA")) Then
btnCorrespondenseACH.Checked =
True
Dim index As Integer = 0
If Not IsDBNull(dt.Rows(0).Item("ZZ_ACH_VIA")) Then
index = FindToggleStates(dt.Rows(0).Item(
"ZZ_ACH_VIA"), btnToggle2)
'btnToggle2.SelectedToggleStateIndex = index
End If
btnToggle2.ToggleStates(index).Selected =
True
btnToggle2.ToggleStates(index).Text = dt.Rows(0).Item(
"ZZ_ACH_VIA")
End If
<< I used the function below to get the correct index by the text matching the button text.>>
Function
FindToggleStates(strText As String, oBtn As Telerik.Web.UI.RadButton) As Integer
Dim iRetVal As Integer = 0
For i As Integer = 0 To oBtn.ToggleStates.Count - 1
If String.Compare(oBtn.ToggleStates.Item(i).Text, strText, True) = 0 Then
iRetVal = i
Exit For
End If
Next
Return iRetVal
End Function