Hi guys
I sit with a situation on my hands where i always need a blank row in the grid which for a user to edit as a new row.
I know the grid has functionality to have a new row on top,bottom or with a button... i cant use this...
Im also using a rowedittemplate on this grid... can anyone suggest how to do this?? bearing in mind that on cancel of the rowedittemplate removes the blank row...
Hello Burmo,
Could you please review the sample attached to this post and see if it meets your requirements.Please feel free to let me know if I misunderstood you or if you have any other questions.
Pure genius Boris.... thank you... just 1 thing... how can i make this the active row on intialize layout and then also after the rowedittemplate ok button click?
how do i remove this row on cancel of the template...?
Glad to hear that this helped.
For your current requirement I will suggest that you could use the Form's 'Load' event and the following code in it:
ultraGrid1.Rows.TemplateAddRow.Activate();
If you want to be sure that this is working you could check it with:
Console.WriteLine("The active row's collection index of the control is now: " + ultraGrid1.ActiveRow.VisibleIndex);
in the end of the Load event and in the end of the 'btnTemplateOk_Click_1' event.
As to the 'Cancel' button - if you click it, this last row will be removed as a 'DataRow' and will just have a visual representation as 'TemplateAddRow'.
Please let me know if I have not expressed myself clearly.
Hi
Thanks for following up but everything seems fine thanks
Hello Brumo,
We are still following this forum thread.
Please feel free to let us know if you still need any assistance with this matter.
Please try the following code:
ultraGrid1.KeyActionMappings.Add(new GridKeyActionMapping(Keys.Enter, UltraGridAction.NextCellByTab, UltraGridState.CellLast, 0, Infragistics.Win.SpecialKeys.Alt, 0));
and take a look at the following link:
http://help.infragistics.com/Help/NetAdvantage/WinForms/2012.1/CLR2.0/html/Infragistics2.Win.UltraWinGrid.v12.1~Infragistics.Win.UltraWinGrid.UltraGrid~KeyActionMappings.html
Please do not hesitate to contact me if you need any additional assistance.
Hi boris..
Everytime i press enter key on a cell it seems to create a new line.... and apply focus to that line... is there property in the grid to changes this...? basically on enter key i want to tab to next cell in the active row??