Hi,
Can the ultragrid mimic the default behave of the windows DataGridView where a new row is automatically added when you start entering data on the first/previous row? or after you press tab on the last column of the row?
I found the property "AllowAddNew.TabRepeat" that according to the description was the thing I was looking for, but it's not happening...
e.Layout.Override.AllowAddNew = AllowAddNew.TabRepeat;
I added this line of code in the InitializeLayout of my ultragrid but it's not adding the new row when I Tab, Tab, Tab until the last column...
Did I miss anything?
My data source is a simple dataTable and my version of infragistics 2009
Thanks!
Hi Monica,
I'm not sure I understand what the problem is.
TabRepeat only adds a new row when the user is editing the AddNewRow and tabs out of the last cell. It will not work on an existing row if that's what you want.
You could probably implement that yourself using the BeforePerformAction event. But it's not entirely clear to me what behavior you want, exactly, so it's hard for me to be more specific.
I click on the Add button and it adds the first row to the grid, I fill out the information, press tab until the last column and keep pressing tab, but it doesn't automatically add a new row...
here is my code.
private void toolStripButtonAdd_Click(object sender, EventArgs e)
{ try { ultraGridColumns.DisplayLayout.Bands[0].AddNew(); } catch (Exception ex) { UtilMsgBox.LogAndShowErrorMsg(ex); } }
private void ultraGridColumns_InitializeLayout(object sender, InitializeLayoutEventArgs e) { try { e.Layout.AutoFitStyle = AutoFitStyle.ResizeAllColumns; e.Layout.Override.CellClickAction = CellClickAction.EditAndSelectText; e.Layout.Override.AllowAddNew = AllowAddNew.TabRepeat; e.Layout.Override.SupportDataErrorInfo = SupportDataErrorInfo.CellsOnly; } catch (Exception ex) { UtilMsgBox.LogAndShowErrorMsg(ex); } }
Do you have an AddNew row inserted? Please take a look at the following link:
http://help.infragistics.com/Help/NetAdvantage/WinForms/2011.2/CLR2.0/html/Infragistics2.Win.UltraWinGrid.v11.2~Infragistics.Win.UltraWinGrid.AllowAddNew.html.
It says: "TabRepeat New Rows can be added by the user, and pressing the TAB key from within the last cell on an AddNew row will automatically add a new row.".
Try using:
ultraGrid1.DisplayLayout.Bands[0].AddNew();
and let me know if it helps.