Link to home
Start Free TrialLog in
Avatar of BobX
BobX

asked on

Very Urgent - MSFlexiGrid

I am using an MSFlexiGrid in my application.

I have the following problem with it and i am not in the position to purchase or use a different grid.

I am using the grid as a booking system viewer so that the user can see which rooms are booked and for what periods i.e AM, PM, FD (full day). The problem is that the user needs to be able to click on the booking and be able to view the appropriate booking record. Since i can only store the period in each cell it makes it difficult to find their record e.g. find all recs where period = AM (this would find many records). I have found a rowdata and coldata property but this only allows me to assign a booking code to a group of cells and not a single cell. If i could also assign the booking code to each single cell i could then simply search for the record using the booking code.

Does anybody know a way around this or any information on the subject?

Thanks in advance.
ASKER CERTIFIED SOLUTION
Avatar of dabellei
dabellei

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
If one row = one booking code then:

It sounds like you want to store the record key in the grid, but do not want the user to necessarily see the key?  What I do is to put the key in either the first (fixed) column (column 0) or I put it in the last column (MyGrid.Cols - 1).  If I put the key in the last column, then I usually set that column's width to zero so that the user will not see it.  Then, whenever your user clicks on a row, you can get the key using:

Dim sKey as string

    sKey = MyGrid.TextMatrix(MyGrid.Row, (MyGrid.Cols - 1))
or
    sKey = MyGrid.TextMatrix(MyGrid.Row, 0)

if you put the key in the first column.

Else if one Cell = one booking code, then one thought is that you could actually double up the number of columns in your grid, and make every even column number's width = 0.  In this cell, you could store your booking code for the cell to it's left.  Awkward, but it would work.

MD