Hi All,
I am working with an UltraGrid in Vstudio2010 and infragistics 2011.2.
I would like to restrict any data modifications (insert, update, delete) to the RowEditTemplate (RET) associated with that rows band. However, I do not necessarily want the RET to automatically pop-up(which appears to be the behavior associated with the RowEditTemplateUIType = on enter/edit). I would like the user to be able to copy data from cells(but not modify or change) in the data grid, without having the RET automatically open. then when the user either double clicks the row they enter the rowedittemplate(similar to the RETUIType = on double-click).
Looking forward to your advice.
Cheers,
Rick
Thank you Hristo. That answered my question exactly. Have a great day and thanks again.
Hello ,
As far as I understand from the description of your scenario, you want to allow user to update UltraGrid’s cells, only via UltraGridRowEditTemplate. Also UltraGridRowEditTemplate should be displayed only on double click of a cell.
First you should set UltraGrid.DisplayLayout.Ovveride.RowEditTempllateUIType to OnDoubleClickRow, then on InitializeLayout event of UltraGrid, set CellActivation of each column to ActivateOnly. I could suggest you to use a method like the following, in order to manage the CellActivation of UltraGird’s Columns:
private void SetCellActivation(Infragistics.Win.UltraWinGrid.Activation activation, UltraGrid grid)
{
foreach (UltraGridBand band in grid.DisplayLayout.Bands)
foreach (UltraGridColumn col in band.Columns)
col.CellActivation = activation;
}
So customer will be able to copy and select the text from UltraGrid’s cells, but they wouldn’t be able to edit the cells’ content. Also you should handle BeforeRowEditTemplateDisplaed event of ultraGird, in order to allowed editing of the cells (SetCellActivation(Activation.AllowEdit, (UltraGrid)sender);) and also to handled AfterRowEditTemplateClosed event of UltraGird, in order to disable the customer to edit the cells’ content (SetCellActivation(Activation.ActivateOnly, (UltraGrid)sender);). I have implemented a simple sample in order to demonstrate my idea. Please run the sample and let me know if this is what you are looking for. Please let me know if I am missing something.
Please let me know if you have any further questions