DevExpress GridView PostEditor
I have a grid control with unbound columns in it. The question is, everytime I change a cell value (I am using a repository item) I immediately call the gridview.PostEditor() method so that it would right away update the grid data which requires to be updated everytime I change a specific cell. Keep in mind that I am using the PostEditor() method so that I dont have to los开发者_StackOverflow中文版e the focus on a cell first to update the gridview. Anyway, calling the PostEditor() will update my grid (which works fine) and still have the reposiroty item open, a repositoty item spin edit control to be exact, but the thing is if I hit a numeric key, It will discard the old value and replace it with the new one. I don't want it to behave like this. I want it so if the old value is 10.00 and I press the "0" key it will change the value to a "100.00" not back to "0.00".
Please help!
Thanks! :)
I dont know if I understand the question. But I did a search on some of my personal devexpress stuff and found this:
private void riSpinEdit_EditValueChanged(object sender, EventArgs e)
{
TextEdit edit = grdReceiveGoods.FocusedView.ActiveEditor as TextEdit;
if (edit != null)
{
int len = edit.SelectionLength;
int start = edit.SelectionStart;
grdReceiveGoods.FocusedView.PostEditor();
edit.SelectionLength = len;
edit.SelectionStart = start;
}
}
Let me know if this solves your problem.
精彩评论