Welcome To The Home Of The Visual FoxPro Experts  
home. signup. forum. archives. search. google. articles. downloads. faq. members. weblogs. file info. rss.
 From: Ken Blum
  Where is Ken Blum?
 Chicago
 Illinois - United States
 Ken Blum
 To: Tõnis Pihlakas
  Where is Tõnis Pihlakas?
 Tallinn
 Estonia
 Tõnis Pihlakas
 Tags
Subject: RE: TimeTextBox + Grid
Thread ID: 33936 Message ID: 34279 # Views: 1 # Ratings: 0
Version: Visual FoxPro 8 Category: Grids
Date: Thursday, December 11, 2003 5:51:30 PM         
   


> >
> > No, it should just be container. The CurrentControl is what is used when the user enters the grid cell. The binding is handled in the container.textboxtobind.ControlSource. You may also need to remove the column.controlsource value, as this could cause a problem of the column attempting to set the value in the table. For the container control to display without the user entering the cell, you need to set column.sparse = .F.
> >
> >
> > KTB
>
> drn, must be missing something again. When I tried to use this container in a grid, the value changes not just in the active row, but on all rows. But it changes just within the container.textboxtobind, it all works from the viewpoint of the cursor. Seems like some sort of a refreshing problem.
>
> grid.recordsource="c_cursor"
> grid.recordsourcetype=Alias (1)
> column1.container.textboxtobind.controlsource="c_cursor.time"
> column1.controlsource=""
> column1.Sparse=.F.
>
> there's some code in container's init() and container.textboxtobind.refresh()
>
> The same problem happens with your class, so it must be something with the grid's or column's settings...
>
> Thanks
> T6nis
>
> A Quick Brown Fox Jumps Over The Lazy Dog
Yeah, I have the same problem. This is because the container is not tied to a data source in the grid which relies on such. Grids always throw a wrench into things.

For a grid, you will have to rethink this altogether. Grids can contain multiple objects, so perhaps you should try adding 2 textbox controls in the column, one for display and another for data entry, setting the default CurrentControl to the display textbox and setting the currentcontrol of setfocus of the column to the data entry textbox. You will have to play around with the value, refresh, and controlsource properties/methods of each of these to get the desired results. Remember that a controlsource does not necessarily have to be bound directly to data, it could be bound to an expression which of course makes the control read-only. So, maybe your display controlsource could be something that would convert your numeric time into a character formatted time like TRANSFORM(timefield,'99:99').
KTB

ENTIRE THREAD

TimeTextBox + Grid Posted by Tõnis Pihlakas @ 12/5/2003 8:59:28 AM
RE: TimeTextBox + Grid Posted by Lucy Alice Pilanga @ 12/5/2003 9:35:59 AM
RE: TimeTextBox + Grid Posted by Tõnis Pihlakas @ 12/5/2003 9:59:31 AM
RE: TimeTextBox + Grid Posted by Lucy Alice Pilanga @ 12/5/2003 10:16:49 AM
RE: TimeTextBox + Grid Posted by Tõnis Pihlakas @ 12/5/2003 10:31:37 AM
RE: TimeTextBox + Grid Posted by Ken Blum @ 12/5/2003 4:40:56 PM
RE: TimeTextBox + Grid Posted by Tõnis Pihlakas @ 12/8/2003 4:38:10 PM
RE: TimeTextBox + Grid Posted by Tõnis Pihlakas @ 12/8/2003 6:20:29 PM
RE: TimeTextBox + Grid Posted by Ken Blum @ 12/8/2003 8:36:04 PM
RE: TimeTextBox + Grid Posted by Tõnis Pihlakas @ 12/9/2003 1:41:52 PM
RE: TimeTextBox + Grid Posted by Ken Blum @ 12/9/2003 4:27:04 PM
RE: TimeTextBox + Grid Posted by Tõnis Pihlakas @ 12/10/2003 8:17:23 AM
RE: TimeTextBox + Grid Posted by Tõnis Pihlakas @ 12/11/2003 9:26:04 AM
RE: TimeTextBox + Grid Posted by Ken Blum @ 12/11/2003 5:51:30 PM