Note that there are some explanatory texts on larger screens.

plurals
  1. POC#. WPF. observablecollection how to get current items
    primarykey
    data
    text
    <p>This is my collection :</p> <pre><code>ObservableCollection&lt;CheckInData&gt; _CheckInCollection = new ObservableCollection&lt;CheckInData&gt;(); public ObservableCollection&lt;CheckInData&gt; CheckInCollection { get { return _CheckInCollection; } } public class CheckInData { public string RoomNumber { get; set; } public string Price { get; set; } public string Currecny { get; set; } public string Discount { get; set; } public string CheckOut { get; set; } public string TotalDay { get; set; } public decimal TotalPrice { get; set; } public int CheckOutYear { get; set; } public int CheckOutMonth { get; set; } public int CheckOutDay { get; set; } public Boolean IncToday { get; set; } public string CheckIn { get; set; } public decimal MoneyRate { get; set; } } </code></pre> <p>I have one class where i save export my collection this way:</p> <pre><code>foreach (CheckInData coll in CheckInCollection) { var roomType = (from d in db.SelectRooms where d.roomnumber == coll.RoomNumber select d.roomtype).SingleOrDefault(); inv._RoomType.Add(roomType.ToString()); inv._RoomNumber.Add(coll.RoomNumber.ToString()); inv._CheckIn.Add(coll.CheckIn); inv._CheckOut.Add(coll.CheckOut); inv._DayNight.Add(coll.TotalDay); inv._RoomPrice.Add(coll.Price); inv._Discount.Add(coll.Discount); } </code></pre> <p>This code works perfectly. I have list view which is binding with this observable collection so my question is how i can insert into <code>inv._RoomType</code>, <code>inv._RoomNumber</code>... only that collection which(rows) are selected in <code>listview</code>. <code>inv._RoomNumber.Add(coll.RoomNumber(listview selected items? ??))</code> Thanks</p>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload