I have follwoing feew questions on XtraGrid (Dev Express).
How to enable editing the cell by double clicking on it? by defalut XtraGrid permits cell editing if we j开发者_运维知识库ust click on it. I dont want this to be happen.
How do I get the column/Row information which is edited?. Is there any event like AfterRowEdit() or AfterCellEdit()?
Thanks, Omkar
1 You could capture the click event and enable the editor if its clicked twice in a short timespan. 2 To get column/row information I would add a special editor to the column and capture its events.
Try setting the OptionsBehaviour.EditorShowMode property of your view to MouseDownFocused. That way the user has to focus the cell first, and the editor will show up only on second click.
Have a look at view's ValidateRow event, or if you need any processing BEFORE editing a row, you could use the view's ShowingEditor event, and grab the actual row by the view's FocusedRowHandle property.
- Disable the gridview editor.
- capture DoubleClick event on the gridcontrol.
- And in this event enable the gridview editor
===========
Bind each column to a repository item
- Go to a column and find the columnedit property.
- Set a repository item to that column.
- Then assign the validating event to the repository item.
Code:
private void your_gridcontrol_double_click(object sender, EventArgs e)
{
GridHitInfo hit = your_gridview.CalcHitInfo((e as MouseEventArgs).Location);
if (hit.InRow)
{
}
}
精彩评论