Hi Every one,
I try to find a way to change the content of a cell programmaticaly.
I found this thread:http://www.telerik.com/community/forums/wpf/gridview/change-the-cell-content-at-runtime.aspx
But it doesn't work for me.
my gridview is link to a dataset. when I modify manually the value of the cell through the interface everything is fine. But if I modify it by code, nothing change.
I don't know if a dataset implement INotifyPropertyChanged but how can I have the value change by code.
I also try with using beginedit function and commitedit but still not work
.
Thank you
I try to find a way to change the content of a cell programmaticaly.
I found this thread:http://www.telerik.com/community/forums/wpf/gridview/change-the-cell-content-at-runtime.aspx
But it doesn't work for me.
my gridview is link to a dataset. when I modify manually the value of the cell through the interface everything is fine. But if I modify it by code, nothing change.
I don't know if a dataset implement INotifyPropertyChanged but how can I have the value change by code.
I also try with using beginedit function and commitedit but still not work
.
Thank you
private void gridMain_MouseDoubleClick(object sender, MouseButtonEventArgs e) |
{ |
GridViewCell currentCell = (GridViewCell) gridMain.CurrentCell; |
if (currentCell.DataColumn.DisplayIndex > 17) |
{ |
if (currentCell.Foreground == Brushes.Red) |
{ |
currentCell.Foreground = Brushes.Black; |
currentCell.Value = currentCell.Value.ToString().Replace("*", ""); |
} |
else |
{ |
currentCell.Foreground = Brushes.Red; |
currentCell.Value = currentCell.Value.ToString() + "*"; |
} |
} |
} |