I am trying to give the user the runtime option to select whether new records are added at the top or bottom of the grid. I can't find any example code, but it looks like it can be done. Can anyone help me with this code to toggle between add row at the top and add row at the bottom? This currently doesn't do anything: Private Sub chkAddBottom_CheckedChanged(sender As Object, e As EventArgs) Handles chkAddBottom.CheckedChanged If chkAddBottom.CheckState = CheckState.Checked Then grdGrid.DisplayLayout.Override.AllowAddNew = AllowAddNew.TemplateOnBottom grdGrid.DisplayLayout.Override.AllowAddNew = AllowAddNew.FixedAddRowOnBottom Else grdGrid.DisplayLayout.Override.AllowAddNew = AllowAddNew.TemplateOnTop grdGrid.DisplayLayout.Override.AllowAddNew = AllowAddNew.FixedAddRowOnTop End If End Sub
Hello Ted,
Thank you for contacting Infragistics!
When I test this behavior I am able to see the AddNewRow when it set AllowAddNew to FixedAddRowOnTop, TemplateOnTop, TemplateOnBottom, or FixedAddRowOnBottom. I used version 17.2.20172.2006 to test this.
What version are you using?What properties do you enable or disable on the grid?
As a note currently when changing the AllowAddNew you are changing it twice for each time the checkbox is checked. You will want to pick the style you want Fixed or Template and only change it to that not change it to one then the other.
Thank you for your reply! I am using UltraWinGrid 17.2.20172.2006.
Please see attached screenshot for grid settings.
Note that the add row has been working perfectly for years. I only want to toggle it to the bottom of the screen when desired.
Thank you for the update. In the property window I don’t see anything that would prevent the AddNewRow from swapping from the top to the bottom. The best way for us to assist you is if you provide a small isolated sample that we can run and use for debugging locally. If you are unable able to provide an isolated sample I may be able to give suggestions if you provide the code for your page.