I have text column in xamWebGrid that retrive color name from sql data. In CellControlAttached event I convert that value to cell background color. Now I want clear cell value, since I don't need to show that value in cell. The problem is cell value is read only in this event. What should I do?
Thanks
If the grid is bound to a RIA control and you change something the datagrid does not refresh the values. I am trying to cancel an edit operation and set the value back to what is in the grid.data.property. When I do this it does not refresh the grid value. Since there is no setter property when you bind the grid to a RIA control, how does it know to refrehe the dsta? Here is where I change the data in the grid:
if (e.Cell.Column.Key == "QuantityOrdered") { Infragistics.Silverlight.Controls.RowBase row = e.Cell.Row; PurchaseOrderItemsHelper purchaseOrderItemsHelper = row.Data as PurchaseOrderItemsHelper; if (int.Parse(e.Cell.Value.ToString()) < purchaseOrderItemsHelper.MinOrder) if (purchaseOrderItemsHelper.MinOrder != 0) { if (dgEditItems.Tag == "Fired") { dgEditItems.Tag = ""; } else { dgEditItems.Tag = "Fired"; MessageBox.Show("The value entered must be greater or equal to the minimum order value;"); e.Cancel = true; purchaseOrderItemsHelper.QuantityOnOrder = intOldQuantityValue; } } }
Any ideas?
Hi,
You shouldn't really be using Cell.Value. It's there for convenience, however, if you know what your data is, it's better to use your data object.
YourData data = e.Cell.Row.Data as YourData;
if(data != null)
{
data.PropToChange = null;
}
Assuming you implement INotifyProperyChanged on your data object, and you you raise the PropertyChanged event in the property's setter, the cell will update immediately.
-SteveZ