Welcome To The Home Of The Visual FoxPro Experts  
home. signup. forum. archives. search. google. articles. downloads. faq. members. weblogs. file info. rss.
 From: Sandy Stephen
  Where is Sandy Stephen?
 Pune
 India
 Sandy Stephen
 To: Mike Gagnon
  Where is Mike Gagnon?
 Pointe Claire
 Canada
 Mike Gagnon
 Tags
Subject: RE: FLEXGRID
Thread ID: 249264 Message ID: 249289 # Views: 5 # Ratings: 0
Version: Visual FoxPro 9 Category: Grids
Date: Thursday, December 31, 2009 1:45:19 PM         
   


> > Hi,
> > I have a FlexGrid with 2 columns. In column file names are displayed. In column 2 user some text information will be displayed. The text information should be entered by user when the user double click on the 2nd column. How can I get input from user in a flexgrid?
> > Please help
> >
> > Regards
> > Sandy
>
> Here is an example (It is up to you write code to pick up the values entered when the user hits save)
>
PUBLIC oform1
> 
> oform1=NEWOBJECT("form1")
> oform1.Show
> RETURN
> DEFINE CLASS form1 AS form
> 
> 	Top = 157
> 	Left = 252
> 	Height = 263
> 	Width = 609
> 	DoCreate = .T.
> 	Caption = "Form1"
> 	Name = "Form1"
> 
> 
> 	ADD OBJECT olecontrol1 AS olecontrol WITH ;
> 		Top = 24, ;
> 		Left = 48, ;
> 		Height = 193, ;
> 		Width = 400, ;
> 		Name = "Olecontrol1", ;
> 		OleClass = "MSFlexGridLib.MSFlexGrid.1"
> 
> 
> 	PROCEDURE olecontrol1.KeyPress
> 		*** ActiveX Control Event ***
> 		Lparameters keyascii
> 		With This
> 			Do Case
> 			Case keyascii=8 &&IF KEY IS BACKSPACE THEN
> 				If .Text <> ""
> 					 .Text =	Left(.Text, (Len(.Text) - 1))
> 				Endif
> 			Otherwise
> 				.Text = alltrim(.Text) + Chr(keyascii)
> 			Endcase
> 		Endwith
> 	ENDPROC
> 
> 
> 	PROCEDURE olecontrol1.Init
> 		USE HOME(2)+"\Tastrade\Data\customer.dbf" AGAIN IN 0 SHARED
> 		Local lngWidth, i, x
> 		lngWidth  = 2200 && Twips
> 		Select customer
> 		Count To x
> 		With This
> 		      .Cols = 3
> 		      .Rows = 0
> 		      .AddItem(Chr(9)+"Name"+Chr(9)+"Number")
> 		      .Rows = x  
> 		      .FixedRows = 1
> 		      .WordWrap = .T.
> 		      .RowHeight(0) = .RowHeight(0) * 2
> 		      .ColWidth(0) = lngWidth / 2  
> 		      .ColWidth(1) = lngWidth*1.5
> 		      For intLoopCount = 1 To (.Rows-1)
> 		            .TextMatrix(intLoopCount, 0) = "Item #" +Transform(intLoopCount) 
> 		      Next intLoopCount
> 		      Select customer
> 		      i = 1
> 		      scan
> 		            .TextMatrix(i, 1) = customer.company_name
> 		            i = i + 1
> 		            If i = x 
> 		                  Exit
> 		            Endif
> 		      Endscan
> 		Endwith
> 		 
> 	ENDPROC
> 
> 
> ENDDEFINE

>
>
> Mike Gagnon
> Refox XI +(English version)

You show the data in 2nd column from the customer table. But I want to say that the data in 2nd column will be entered by user by manual typing. How can I do that?

Sandy

ENTIRE THREAD

FLEXGRID Posted by Sandy Stephen @ 12/31/2009 7:44:16 AM
RE: FLEXGRID Posted by Mike Gagnon @ 12/31/2009 1:30:04 PM
RE: FLEXGRID Posted by Sandy Stephen @ 12/31/2009 1:45:19 PM
RE: FLEXGRID Posted by Mike Gagnon @ 12/31/2009 1:55:13 PM
RE: FLEXGRID Posted by Sandy Stephen @ 12/31/2009 1:59:46 PM
RE: FLEXGRID Posted by Mike Gagnon @ 12/31/2009 2:10:56 PM
RE: FLEXGRID Posted by Sandy Stephen @ 12/31/2009 2:21:36 PM
RE: FLEXGRID Posted by Mike Gagnon @ 12/31/2009 2:27:33 PM
RE: FLEXGRID Posted by Sandy Stephen @ 12/31/2009 2:39:41 PM
RE: FLEXGRID Posted by Anders Altberg @ 1/1/2010 2:41:49 PM