Your Privacy Matters: We use our own and third-party cookies to improve your experience on our website. By continuing to use the website we understand that you accept their use. Cookie Policy
4032
How add and initialize rows to WinGrid bound to UltraDataSource
posted

Hello all,

I have a grid bound to UltraDataSource. Each row of the grid contains data for one employee. Every column stands for one day. The row tag is set to a business object that contains some information about the employee and some properties to sort the rows properly. After initializing DataSource and grid rows everything looks fine.

Users should be able to add new rows to the grid, one new row for every employee. What is the best approach to solve this? I loop through the existing rows, and should add a new row for every employee (identified by the row tag). At this moment, employees can have different counts of rows (at least one).

I'm facing the following problems:

  • UltraDataRow has no constructor with parameter for the row tag.
  • Using the Add method of the UltraDataSource rows collection, the Initialize_Row event of the grid is called. But the row can not be properly initialized without tag object.
  • Using the RowAdded event of the UltraDataSource rows collection, the event args have no information to initialize the tag object either.

Do I missing something, or what is the best approach for my problem?

Thanks for any suggestions.

Markus