Quantcast
Channel: Silverlight 5 forum
Viewing all articles
Browse latest Browse all 1083

Send data to childwindow

$
0
0

Hi, I want to display single row from datagridview in childwindow using constructor. I get Id row from combobox.SelectedValue. Below is my constructor with class parameter.

 public Child_Update(My_Class raport)


and my click method

 private void btn_Click(object sender, RoutedEventArgs e)
        {
            if (my_ComboBox.SelectedItem == null)
            {

            }
            else
            {
                var my_rows = ((ObservableCollection<My_Class>)(My_datagrid.ItemsSource));
                 int nr_id = int.Parse(my_ComboBox.SelectedValue.ToString());

 var row = from w in my_rows where w.ID == nr_id select w;

 Child_Update child_up = new Child_Update((My_Class)(row));

child_up.Show();
            }
        }

When I debuggin error occurred:

"Unable to cast object of type 'WhereEnumerableIterator`1[MyAPP_Silverlight.ServiceReference2.My_Class]' to type 'MyAPP_Silverlight.ServiceReference2.My_Class'."

How can i avoid this?


Viewing all articles
Browse latest Browse all 1083

Trending Articles



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