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

Get WPF RadGridDataGrid row and cell

1 Answer 119 Views
GridView
This is a migrated thread and some comments may be shown as answers.
Ileana
Top achievements
Rank 1
Ileana asked on 28 Sep 2012, 04:17 PM
Hello, I would like to know how I can get the value of a particular row / column in RadGrdiView of Wpf
like a telerik web gridview (findcontrol)
Actually I can get the value in a DataGrid wpf, that is my function

Private Function GetCellValue(ByRef dataGrid As DataGrid, ByVal row As Integer, ByVal column As Integer) As String
        Dim temprow As DataGridRow
        Dim rowview As DataRowView
        Dim cellValue As String
        GetCellValue = ""
        Try
            temprow = dataGrid.ItemContainerGenerator.ContainerFromIndex(row)
            rowview = temprow.Item
            cellValue = rowview.Item(column).ToString
        Catch ex As Exception
            cellValue = ""
        End Try
        Return cellValue
   End Function

But when I do the same with telerik, I cant, that give the next error
Unable to cast object of type 'Telerik.Windows.Controls.GridView.GridViewRow' to type 'System.Windows.Controls.DataGridRow'.
if you can give me a solution, will be grateful

1 Answer, 1 is accepted

Sort by
0
Dimitrina
Telerik team
answered on 29 Sep 2012, 07:05 AM
Hello,

You should define the "tempRow" as GridViewRow.

Kind regards,
Didie
the Telerik team

Time to cast your vote for Telerik! Tell DevPro Connections and Windows IT Pro why Telerik is your choice. Telerik is nominated in a total of 25 categories.

Tags
GridView
Asked by
Ileana
Top achievements
Rank 1
Answers by
Dimitrina
Telerik team
Share this question
or