Hi,
I'm experiencing a peculiar problem that I think has to do with my peculiar situation. We are displaying a XamDataGrid which has it's columns defined by the records. When there are no records, there WERE no column headers and thus no add row, sorting, etc. I was able to fix this by adding in the columns in the "AssigningFieldLayoutToItem" event (the columns are dynamically read in from the database, as shown in the fix link). The add row row is now visible at the top as desired, but once I enter the edit mode and start typing into a particular column, I can't tab or click to any of the other columns until I back out all of my changes for that cell. It appears to be "stuck" on the edit mode for that cell and won't leave. Additionally, my calendar controls are not active (probably because the columns don't know they are date fields without actual data?).
Any thoughts on why this might be happening or solutions? Users absolutely must be able to enter new records into a grid and see the column headers even if there are no existing records in the grid. All of our tables and columns are dynamically read in and assigned editors and properties based on database column configurations. Interested in hearing your thoughts.
Thanks,
Danielle
Ah, yes. So I was under the impression that we WERE doing this when we load the screen. It turns out we were doing a null check when we should have been doing a count check, so our DataTable wasn't actually getting populated with any of the columns. Once I fixed this all of the column controls and headers loaded without the use of my AssigningFieldLayoutToItem hack.
Thanks!
Hello Danielle,
Thank you for your post.
While I was not able to reproduce this behavior you are seeing, I do have a suggestion for you. I tested this using a DataTable and binding the table's DefaultView to the XamDataGrid when there were no rows in the table, since I do not have a database to load into the grid at the moment. This appears to work correctly with the AddNewRow and the calendars for the DateTime fields.
So, my recommendation to you is rather than creating fields in the AssigningFieldLayoutToItem event based on the TableInfo and ColumnConfig objects, why not create a DataTable and create a column for each of the fields that you would normally create in the AssigningFieldLayoutToItem event? Then, you can bind that data table's default view to the XamDataGrid, and everything should work as expected. I am not entirely sure if this is an option for you, as I am not very familiar with the TableInfo and ColumnConfig objects, but it appears that you are able to create fields in the grid using those objects, so this option should work as well.
Please let me know if you have any other questions or concerns on this matter.
Sincerely,AndrewAssociate DeveloperInfragistics Inc.www.infragistics.com/support