I have a wpf datagrid that and am trying to cast a datagrid.SelectedItem to a custom object. Getting the error "Unable to cast object of type 'System.Data.DataRowView' to type 'CarrierRecord'." when this line "set carrierRecord to DG_CellCarriers::SelectedItem as type CarrierRecord" is executed. Works just fine in c#. Am I missing something basic here? My datagrid is bound to a datatable.
I have a wpf datagrid that and am trying to cast a datagrid.SelectedItem to a custom object. Getting the error "Unable to cast object of type 'System.Data.DataRowView' to type 'CarrierRecord'." when this line "set carrierRecord to DG_CellCarriers::SelectedItem as type CarrierRecord" is executed. Works just fine in c#. Am I missing something basic here? My datagrid is bound to a datatable.
method-id dataGrid1_SelectionChanged.
procedure division using by value sender as object e as type System.Windows.Controls.SelectionChangedEventArgs.
declare selectedrow as type System.Data.DataRowView = self::dataGrid1::SelectedItem as type System.Data.DataRowView
declare mystring as string = selectedrow::Row::ItemArray[1]
end method.
I have a wpf datagrid that and am trying to cast a datagrid.SelectedItem to a custom object. Getting the error "Unable to cast object of type 'System.Data.DataRowView' to type 'CarrierRecord'." when this line "set carrierRecord to DG_CellCarriers::SelectedItem as type CarrierRecord" is executed. Works just fine in c#. Am I missing something basic here? My datagrid is bound to a datatable.
set carrierRecord to DG_CellCarriers::Items::CurrentItem as type CarrierRecord:
Consider, a new row is not of type CarrierRecord (CanUserAddRows="True")
Following 2 statements select same object in my program::
set GridZeile to DGWerte::Items::CurrentItem as type WPFApplDataGrid.GridZeile:
set GridZeile to DGWerte::SelectedItem as type WPFApplDataGrid.GridZeile:
Sign up
Already have an account? Login
Welcome to the Rocket Forum!
Please log in or register:
Employee Login | Registration Member Login | RegistrationEnter your E-mail address. We'll send you an e-mail with instructions to reset your password.