Page 1 of 1

Restricting selection to particular cells in a table

Posted: Fri Aug 07, 2009 12:16 pm
by ConvertFromOldNGs
by pillick >> Mon, 18 Nov 2002 23:03:12 GMT

Hi

I'm trying to setup a dialog for selecting a date. It looks very similar to the windows dialog that shows when you double click the time in your system tray.

Ive done the day part in a table, with each day being a seperate cell.

Some cells are empty, and I dont want the user to be able to select them. Also I want to be able to set up a filter so that the user can only select mondays, or sundays, or the first and last days of the months.

There is a property for the whole table that decides how items are selected, but what about for each individual cell? How would I make it so that a particular cell cannot be selected with the mouse or keys?

Dave

Re: Restricting selection to particular cells in a table

Posted: Fri Aug 07, 2009 12:16 pm
by ConvertFromOldNGs
by allistar >> Mon, 18 Nov 2002 23:24:08 GMT

Hi Dave,
You could reimplement the "rowColumnChg" (and possibly "click")
events so that if an illegal cell is selected you straight away
unselect it. I'm not sure if this would result in a noticable flicker
but it shold achieve what you want.

Regards,
Allistar.

------------------------------------------------------------------
Allistar Melville
Software Developer
Auckland, NEW ZEALAND

Greentree International,
Developer of Greentree Financial Software. ------------------------------------------------------------------

Re: Restricting selection to particular cells in a table

Posted: Fri Aug 07, 2009 12:16 pm
by ConvertFromOldNGs
by pillick >> Tue, 19 Nov 2002 0:38:44 GMT

Well, that seems to work without a flicker, but the invalid cells end up with a grey box around them when they are clicked. So it still gives the user the impression that clicking on them does something. Can I get rid of this effect?

Re: Restricting selection to particular cells in a table

Posted: Fri Aug 07, 2009 12:16 pm
by ConvertFromOldNGs
by allistar >> Tue, 19 Nov 2002 1:51:33 GMT

That's the cell getting focus. You could remove this by setting the
"row" and "column" to some other cell (but that other cell will have
the grey box instead). The other way it to set focus to a different control on the form.

Regards,
Allistar.

------------------------------------------------------------------
Allistar Melville
Software Developer
Auckland, NEW ZEALAND

Greentree International,
Developer of Greentree Financial Software. ------------------------------------------------------------------

Re: Restricting selection to particular cells in a table

Posted: Fri Aug 07, 2009 12:16 pm
by ConvertFromOldNGs
by hml >> Tue, 19 Nov 2002 9:06:32 GMT

You could use the queryRowColChg event instead. It gives you the new row and column so you can check if the user is "allowed" to put focus in that cell.

Torrie