private void ItemsGrid_Delete(object sender, DataGridCommandEventArgs e) { if (_ShippingMethodDto != null) { int id = Int32.Parse(((DataGrid)sender).DataKeys[e.Item.ItemIndex].ToString()); ShippingMethodDto.ShippingMethodCaseRow row = _ShippingMethodDto.ShippingMethodCase.FindByShippingMethodCaseId(id); if (row != null) { row.Delete(); } } BindItemsGrid(); }