Quantcast
Channel: Our ComponentOne » All Posts
Viewing all articles
Browse latest Browse all 14170

Reply To: C1DataGrid GetCell

$
0
0

My Code:

      AddHandler DataGrid.LoadedRowPresenter, Sub(sender As Object, e As DataGridRowEventArgs)
                                                    For Each objCol In DataGrid.Columns
                                                       Dim objCell = DataGrid.GetCell(e.Row.Index, objCol.Index)

                                                       If objCell.Row.Type = DataGridRowType.Item Then
                                                          If intCurrentRow = objCell.Row.Index And booCurrentValue Then Exit Sub
                                                          If intCurrentRow <> objCell.Row.Index Then
                                                             If booCurrentValue = False Then DataGrid.Rows(intCurrentRow).Visibility = Windows.Visibility.Collapsed
                                                             intCurrentRow = objCell.Row.Index

                                                             If booCurrentValue Then DataGrid.Rows(intCurrentRow).Visibility = Windows.Visibility.Visible
                                                             booCurrentValue = False
                                                             booCurrentValue = LookCell(DataGrid, objCell)
                                                          Else
                                                             booCurrentValue = LookCell(DataGrid, objCell)
                                                          End If
                                                       End If
                                                    Next
                                                 End Sub


 Private Shared Function LookCell(DataGrid As RZADataGrid, Cell As C1.Silverlight.DataGrid.DataGridCell) As Boolean
      Dim retValue As Boolean = False

      If Cell.Text <> String.Empty Then retValue = True : Return retValue

      'If DataGrid.GetCell(Cell.Row.Index, Cell.Column.Index).Text <> String.Empty Then retValue = True : Return retValue
      If Cell.Presenter IsNot Nothing Then
         If GetType(HyperlinkButton).IsAssignableFrom(Cell.Presenter.Content.GetType) Then
            Dim objHyperlinkButton = DirectCast(Cell.Presenter.Content, HyperlinkButton)
            If objHyperlinkButton.Content IsNot Nothing Then
               Dim strText = CStr(objHyperlinkButton.Content)
               If Not String.IsNullOrEmpty(strText) Then retValue = True
            End If
         ElseIf GetType(TextBlock).IsAssignableFrom(Cell.Presenter.Content.GetType) Then
            Dim objTextBlock = DirectCast(Cell.Presenter.Content, TextBlock)
            If objTextBlock.Text <> String.Empty Then retValue = True
         End If
      End If
      Return retValue
   End Function



Viewing all articles
Browse latest Browse all 14170

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>