mikem
  • mikem
  • Member Topic Starter
2021-10-21T14:57:01Z
Hi all,

VB.NET 2019 - MySQL Server - IGrid 10.net

I need to populate a grid using a datasource - that bit is easy. However, I need one of the fields to be the rowindex for the grid. I can do this manually by looping and adding the specific column text as the rowindex. However, mostly there are around 100000 rows, and periodically several million - all unique strings. Ideally, I would like to do this in a single operation during data load. The reason is that I need to find the row containing the row index, then get the data from the corresponding column. I'm averse to doing things twice. :)




Igor/10Tec
2021-10-22T14:23:46Z
iGrid doesn't provide an automatic way to insert row indices into a column during the FillWithData call.

But what if you define a calculated field with the required values in the data source and then feed this data source with one extra column into FillWithData?
mikem
  • mikem
  • Member Topic Starter
2021-10-22T15:44:11Z
An interesting answer, but I think it would slow the query.

I may have worked out another way; what about loading the records into a dataset, then looping through that and adding to the grid F/N using the correct string field as the index value? At least that way the grid only gets 'touched' once and no need to store two copies of the strings to save on memory with large volumes of data.


Igor/10Tec
2021-10-23T10:25:47Z
It's a question what will work faster - creating a new column and populating it in the dataset, or setting 1, 2, 3, ... in the extra iGrid column. As for the latter, you can use the iGrid.CellValues[,] property to set cell values directly without creating cell value objects (compared to the classical iGrid.Cells[,].Value syntax). You can try both ways and tell us which one works faster.