void item_PropertyChanged(object sender, System.ComponentModel.PropertyChangedEventArgs e) { if (e.PropertyName != "IsChanged") { BookingRoomServiceDetail item = (BookingRoomServiceDetail)sender; item.IsChanged = true; } }
void gvwServiceDetails_CellEditEnded(object sender, Telerik.Windows.Controls.GridViewCellEditEndedEventArgs e) { if (e.NewData != null && e.Cell.ParentRow.Item != null) { BookingRoomServiceDetail currentRow = (BookingRoomServiceDetail)e.Cell.ParentRow.Item; string columnName = e.Cell.Column.UniqueName; if (currentRow != null && columnName == "Quantity") { currentRow.TotalPrice = currentRow.Price * currentRow.Quantity; } } }
void gvwServiceDetails_AddingNewDataItem(object sender, Telerik.Windows.Controls.GridView.GridViewAddingNewEventArgs e) { if (_bookingRoomServiceItem != null) { BookingRoomServiceDetail newItem = new BookingRoomServiceDetail(); newItem.BookingRoomServiceId = this.BookingServiceId; newItem.Unit = _bookingRoomServiceItem.Unit; newItem.Price = _bookingRoomServiceItem.Price; newItem.Quantity = 0; newItem.TotalPrice = 0; newItem.IsChanged = true; e.NewObject = newItem; } }