This is a migrated thread and some comments may be shown as answers.

Radiobutton in Detail page

1 Answer 81 Views
GridView
This is a migrated thread and some comments may be shown as answers.
Sarah
Top achievements
Rank 1
Sarah asked on 03 Aug 2012, 08:42 PM
I implemented the example in the GridView >> Hierarchy >> Tabbed Views (CustomDetailViewCellElement)

One of the tabs is a grid and I need a mutually exclusive radio button to indicate which record is the primary.

I try this thread but it only works if there are no hierarchy: http://www.telerik.com/community/forums/winforms/gridview/radiobutton-in-radgridview.aspx#1601100

I thought changing this part of the code to this would work but it doesn't either:
Private Sub radioButtonElement1_MouseDown(sender As Object, e As System.Windows.Forms.MouseEventArgs)
    Me.Value = 1
 
    If Me.ViewTemplate Is GetType(Telerik.WinControls.UI.MasterGridViewTemplate) Then
 
        For Each row As GridViewRowInfo In Me.ViewTemplate.Rows
            If row IsNot Me.RowInfo Then
                row.Cells(Me.ColumnInfo.Name).Value = 0
            End If
        Next
 
    Else
 
        For Each row As GridViewRowInfo In Me.ViewInfo.Rows
            If row IsNot Me.RowInfo Then
                row.Cells(Me.ColumnInfo.Name).Value = False
            End If
        Next
 
    End If
End Sub

Any ideas????

1 Answer, 1 is accepted

Sort by
0
Accepted
Sarah
Top achievements
Rank 1
answered on 06 Aug 2012, 01:25 PM

I solved my issue.

Private Sub radioButtonElement1_MouseDown(sender As Object, e As System.Windows.Forms.MouseEventArgs)
 
        Me.Value = True
 
        Me.TableElement.BeginUpdate()
        For Each row As GridViewRowInfo In Me.ViewInfo.Rows
            If row IsNot Me.RowInfo Then
                row.Cells(Me.ColumnInfo.Name).Value = False
            End If
        Next
 
        Me.TableElement.EndUpdate()
 
 
    End Sub

Tags
GridView
Asked by
Sarah
Top achievements
Rank 1
Answers by
Sarah
Top achievements
Rank 1
Share this question
or