Radiobutton in Detail page

2 posts, 1 answers
  1. Sarah
    Sarah avatar
    4 posts
    Member since:
    Jun 2012

    Posted 03 Aug 2012 Link to this post

    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????
  2. Answer
    Sarah
    Sarah avatar
    4 posts
    Member since:
    Jun 2012

    Posted 06 Aug 2012 Link to this post

    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

Back to Top