I use the virtual mode with my UltraGrid. When a new data record is added to my own data source and I increase UltraDataSource row count by one. Event InitializeRow of UltraGrid is always fired on the last grid row. For example, if a newly added data record is displayed on the top, the InitializeRow event is always fired on the first added data record, since it is tired to the bottom grid row.
If I need to setup row level appearances, I have go through all the grid rows. Is there a way to get around with this issue?
Thanks,
Shaolin
Hi Michael,
I use method SetCount().
Hi Shaolin,
I do understand that you are using the UltraGrid for display, but again, you are adding a row, how are you adding it? If you are adding it to your Root DataSource, and just increasing the UltraDataSource's row count, the UltraGrid only sees that a new row was added to the end because from what you are describing the only notification you gave the grid was via the middle tier DataSource setting it's RowCount to up one, so that would be correct. If you think that is not what is happening, would you be able to mock up a sample that demonstrates the behavior that you are describing?
Thanks for your response!
I have my own data source and the data records in it are sorted. I only use an UltraGrid for display purpose. The UltraGrid does display data correctly in my case. The issue is event InitializeRow is always fired on the bottom row.
I need to get a better understanding of what and how you are doing it. How are you adding the data to the top of your UltraDataSource are you calling Rows.Insert()? If you just adding the row to your backend datasource, and then just calling SetCount(), being that it is virtual, and therefore not directly bound to the UltraGrid, the UltraGrid probably just hasn't gotten notification that your backend changed. You need to refresh it in some way, like grid.Rows.Refresh()
Let me know if that helps,