Juwelix
2019-06-25T15:15:04Z
I bought igrid because it seemed suitable for vba beginners at first sight.
Now I try to integrate igrid actively, and already come across the first questions, which are surely also based on missing VBA knowledge on my part. However, I think that even "beginners" should have the possibility to use igrid. Here would be a few example codes for standard use cases not bad.

Now to my questions:

I want to be able to edit my cells, but I want the whole row to be highlighted when clicking into a cell, so that I can continue to edit the cells. Of course, this selection should also change when changing the focus.

Another very fundamental question: I would like to edit the values of each cell of a multi selection - is there an example code?
Igor/10Tec
2019-06-26T06:50:25Z
First of all, thank you for choosing our product.

If you install the iGrid demo, you get a bunch of VBA samples in the installation folder - look into the VBA_Samples subfolder. Among them you can also find starter samples.

A good source of samples for beginners is the iGrid help file in the CHM format. It is deployed with the demo installation or available for standalone downloading from the website.

Quote:

I want to be able to edit my cells, but I want the whole row to be highlighted when clicking into a cell, so that I can continue to edit the cells.



It's easy to implement with the RowDynamicFormatting event. For example, the following event handler highlights the current row with a gentle violet color:

Private Sub iGrid1_RowDynamicFormatting(ByVal lRow As Long, oForeColor As Long, oBackColor As Long, oFont As stdole.Font)
   If lRow = iGrid1.CurRow Then
      oBackColor = RGB(224, 224, 255)
   End If
End Sub


Pay attention to the fact that you need to enable this event in the grid initialization code:

iGrid1.DynamicContentEvents = igDCEventRowDynamicFormatting


Quote:

I would like to edit the values of each cell of a multi selection - is there an example code?



Sorry, we didn't understand. Do you want to limit editing only by selected cells or what?