Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Refreshing Data in a Grid
Message
From
19/08/2004 07:02:59
 
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Miscellaneous
Thread ID:
00934445
Message ID:
00934449
Views:
27
Hi Neil,

try this:
*Combo1 Interactive change

local lcFilter
Set filter to moc034=thisform.combo1.DisplayValue in crsresult
thisform.grid1.Refresh
>I have a form with a grid which when I open the form in the init event of the grid is a select statement which populates the grid. This works fine!
>
>I then have a combo from which when I select the option in the combo I want to filter the records in the grid. But when I select the combo option my grid returns blank.
>
>Here is my syntax:
>
>
>
>*Grid init
>
>SET DEFAULT TO 'C:\Foxpro Projects\Statistics\'
>
>SELECT * from neil INTO CURSOR crsresult
>
>WITH thisform.grid1
>	.columncount = 13
>	.recordsourcetype = 1
>	.recordsource = 'crsresult'
>	.column1.controlsource = 'key1'
>    .column1.header1.caption = 'Season'
>    .column1.width=50
>    .column1.dynamicbackcolor="IIF(cr1>=-2.01,RGB(255,255,255),RGB(255,0,0))"
>    .column2.controlsource = 'key2'
>    .column2.header1.caption = 'Dept'
>    .column2.width=50
>    .column2.dynamicbackcolor="IIF(cr1>=-2.01,RGB(255,255,255),RGB(255,0,0))"
>    .column3.controlsource = 'key3'
>    .column3.header1.caption = 'Ref'
>    .column3.width=50
>    .column3.dynamicbackcolor="IIF(cr1>=-2.01,RGB(255,255,255),RGB(255,0,0))"
>    .column4.controlsource = 'moc011'
>    .column4.header1.caption = 'Description'
>    .column4.width=300
>    .column4.dynamicbackcolor="IIF(cr1>=-2.01,RGB(255,255,255),RGB(255,0,0))"
>    .column5.controlsource = 'moc019'
>    .column5.header1.caption = 'Size'
>    .column5.width=40
>    .column5.dynamicbackcolor="IIF(cr1>=-2.01,RGB(255,255,255),RGB(255,0,0))"
>    .column6.controlsource = 'moc008'
>    .column6.header1.caption = 'Retail'
>    .column6.width=40
>    .column6.dynamicbackcolor="IIF(cr1>=-2.01,RGB(255,255,255),RGB(255,0,0))"
>    .column7.controlsource = 'round(price2,2)'
>    .column7.header1.caption = 'Cost'
>    .column7.width=40
>    .column7.dynamicbackcolor="IIF(cr1>=-2.01,RGB(255,255,255),RGB(255,0,0))"
>    .column8.controlsource = 'calcname'
>    .column8.header1.caption = 'Country'
>    .column8.width=90
>    .column8.dynamicbackcolor="IIF(cr1>=-2.01,RGB(255,255,255),RGB(255,0,0))"
>    .column9.controlsource = 'round(cr1,2)'
>    .column9.header1.caption = 'Margin'
>    .column9.width=60
>    .column9.dynamicbackcolor="IIF(cr1>=-2.01,RGB(255,255,255),RGB(255,0,0))"
>    .column10.controlsource = 'Descrip1'
>    .column10.header1.caption = 'Fabric'
>    .column10.width=80
>    .column10.dynamicbackcolor="IIF(cr1>=-2.01,RGB(255,255,255),RGB(255,0,0))"
>    .column11.controlsource = 'aconstruct'
>    .column11.header1.caption = 'Type'
>    .column11.width=50
>    .column11.dynamicbackcolor="IIF(cr1>=-2.01,RGB(255,255,255),RGB(255,0,0))"
>    .column12.controlsource = 'agauge'
>    .column12.header1.caption = 'Width'
>    .column12.width=40
>    .column12.dynamicbackcolor="IIF(cr1>=-2.01,RGB(255,255,255),RGB(255,0,0))"
>    .column13.controlsource = 'round(quantity,3)'
>    .column13.header1.caption = 'Rating'
>    .column13.width=40
>    .column13.dynamicbackcolor="IIF(cr1>=-2.01,RGB(255,255,255),RGB(255,0,0))"
>ENDWITH
>
>*Combo1 Interactive change
>
>SELECT crsresult
>Set filter to thisform.combo1.DisplayValue=crsresult.moc034
>
>thisform.grid1.Refresh
>
Previous
Reply
Map
View

Click here to load this message in the networking platform