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 Boris,
Thanks for sending the sample. I can see that works... I just couldn't figure it out what I did differently in my code yet... maybe because I have dropdownlist in my grid?! I don't know. I keep testing.
Hi Monica,
I am checking about the progress of this issue. Please let me know If you need any further assistance on this.
I tried this and it always works fine for me, so I attached my sample to this post for you. Please review it and feel free to let me know if I misunderstood you or if you have any other questions.
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.