Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- { ID = 3, CustomerName = xyz, SaleDate = 05.08.2013 00:00:00, TotalAmount = 10 }
- var copyitem = Datagrid_NewSale.SelectedItem;
- if (copyitem == null)
- {
- MessageBox.Show("Please select values from list");
- }
- if (copyitem != null)
- {
- MessageBox.Show(copyitem.ToString());
- }
- public class CustomerDetailes
- {
- public string CustomerName { get; set; }
- }
- public void viewcustomername()
- {
- List<CustomerDetailes> ilist = null;
- ilist = (from order in db.Customer
- select new CustomerDetailes
- {
- CustomerName= order.CustomerName
- }).ToList();
- txtCustumer.Text = ilist.ToString();
- }
- CustomerDetailes copyitem = (CustomerDetailes)Datagrid_NewSale.SelectedItem;
- if (copyitem == null)
- {
- MessageBox.Show("Please select values from list");
- }
- if (copyitem != null)
- {
- MessageBox.Show(copyitem.ToString());
- }
- txtCustomer.text=copyitem.CustomerName; //CustomerName into a textbox
- List<CustomerDetails> customerDetails = new List<CustomerDetails>();
- List<CustomerDetails> MyCollection
- {
- get
- {
- return myList;
- }
- set
- {
- myList = value;
- PropertyChanged(this, new PropertyChangedEventArgs("MyCollection"));
- }
- }
- <DataGrid ItemsSource="{Binding MyCollection}"/>
- dataGrid.Items.Add(new CustomerDetails(){Name = "abc"}, xyz propertis)
- dynamic copyitem = dataGrid1.SelectedItem;
- int localId = copyitem.ID;
- var query= (from order in db.Customer
- where order.ID=localId
- select order).ToList();
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement