Hello!
In my application I'm trying to get data from a RadGridView in my code behind. Everything is ok if I bind the grid directly from entity data model with just a table, because this code works fine:
Example:
In my application I binded my grid with a linq query and my testgrid(radgrid) correctly shows results.
This is a linq query like the one in my project, used to bind my radgrid:
My problem raises in code behind when I try to retrieve data of the selected row of my testgrid after a double-click event.
Using the first method I have to assign a type for the directcast, but in case of binding with the query I have no idea of what kind of object to put instead of Orders type.
Any suggestion?
BestRegards
In my application I'm trying to get data from a RadGridView in my code behind. Everything is ok if I bind the grid directly from entity data model with just a table, because this code works fine:
Example:
Dim idordine As String = DirectCast(testGrid.SelectedItem, Orders).OrderIDIn my application I binded my grid with a linq query and my testgrid(radgrid) correctly shows results.
This is a linq query like the one in my project, used to bind my radgrid:
Dim query = From employee In employees Join order In orders On employee.EmployeeID = order.EmployeeID Select New With { _ .EmployeeName = employee.LastName, _ .OrderName = order.ShipName, _ .OrderDate = order.OrderDate _}testGrid.ItemsSource = query Me.Griglia.ItemsSource = qryMy problem raises in code behind when I try to retrieve data of the selected row of my testgrid after a double-click event.
Using the first method I have to assign a type for the directcast, but in case of binding with the query I have no idea of what kind of object to put instead of Orders type.
Any suggestion?
BestRegards