My company has a database that the current UI is MS Access via ODBC (Yes I know ....)
Anyhow, I am trying to write a more robust UI but first I need to replicate some of the current features that Access gives us.
The biggest of which is I can select a range of cells in Excel (and assuming that the number of cells per row and data content is correct) can then select the insert row in Access and hit paste and it will insert multiple records into the table.
I am hoping it is somehow possible with UltraGrid to replicate this behavior. Actually I'm hoping it's EASILY possible to replicate this behavior.
I currently have a Binding List of custom object type that gets set as the Ultragrid's Datasource.
Right now I'm thinking that I'm going to have to do something like trapping the Ctrl+V keystroke, check to see if the active row is the add row, cancel the add row and then programmatically create new objects based on the clipboard data and add them to the binding list and then refresh the grid (all of which in my mind is a lot more complex to actually do than it sounds here)
If anyone else has already cracked this nut, I would appreciate any advice, tips, or help you can offer.
Thanks
Steve
Hello Steve, I am glad that you managed to achieve your requirement.
Thank you for using Infragistics!
Mike,
Sorry it took me so long to get back here, had some trouble with my login .
Anyhow in honor of Halloween - I dub thee the Fairy Godfather of Infragistics!!
This is even simpler and easier that anything I could have wished for and I am almost ashamed to admit I had all of those settings in place, I just never thought it would work so I never tried it in my actual project.
This is perfect!
Thanks again and have a great weekend!
Actually... the grid DOES have this functionality built-in.
All you really have to do is turn on the TempalteAddRow (AllowAddNew) and turn on MultiCellOperations for copy and paste. You can select multiple rows in the grid and copy and the select the TemplateAddRow and paste. Or you can select a range of cells (CellClickAction) and paste that into a valid cell in the TempalteAddRow and new rows are created. In my sample, I also have a Read-only primary key field so I also added an event handler for the grid's Error event to handle this without prompting the user.
WindowsFormsApp50.zip