I have a problem with navigation controls, I have a master-detail relation
Ex. Customers and contacts so in my form I have a TPageControl with two
TabSheets, on the first tab I have controls added to the customer info in
the second tab I have controls with contact's info, but when I go to the
sencond tab the navigation controls get disabled, when I back to the first
tab, get enabled ...
it's ok. that feature o how I can disable that?
Some commentaries about that?
Thanks in advanced
Ernesto Buerostro
Are you using the same navigation controls for all sheets? For example, are
you using one DBNavigator for all sheets? If so, you need to make sure you
change the datasource for the DBNavigator when you change tabsheets.
Otherwise when you change to tab2, the navigator is still moving you around
the data on tab1.
Regards,
Ron
"Ernesto Buenrostro" <ernesto...@hotmail.com> wrote in message
news:430221c0$1...@newsgroups.borland.com...
but I'm don't have any code to change the control DataSource, in the second
sheet I have only a grid to show a detail list. so I don't need controls to
manage that sheet, the navigation controls get grayed when I change from
sheet.
Ernesto Buenrostro
"Ron H" <rhe...@leavethisoutpearlrecovery.com> escribió en el mensaje
news:4302...@newsgroups.borland.com...
The reason I am asking these questions is that what you are describing is
not normal behavior for navigation components. To show you, run the
following quick test:
1. Start New Application
2. Put two BDE TTable components on Form. For both set Database to "DBDEMOS"
3. Pur two TDatasource components on form. For Datasource1, set Dataset to
"Table1", for Datasource2 set Dataset to "Table2"
4. For Table1, set TableName to customer.db and set Active to True
5. For Table2, set Tablename to orders.db, set IndexName to "Custno", Set
MasterSource to "Datasource1", Click Masterfields button and join Custno on
both tables, finally set Active to True.
6. On your Form, put a DBNavigator, set Align to "alBottom" and set
datasource to Datasource1
7. Add a TPageControl to form and set Align to "alClient".
8. Right-Click on TpageControl and select "NewPage". Do that a second time
to add a second page.
9. Select Tabsheet1, put a DBGrid on the tabsheet and set DBGrid's Align
Property to alClient and its Datasource to "Datasource1"
10. Select Tabsheet2, put a DBgrid on the tabsheet and set DBGrid's Align
Property to alClient and its Datasource to "Datasource2"
11. Run application
You'll see that when you click on tabsheets it does not impact DBNavigator.
When you use DBNavigator to move forward or backward, it is moving through
datasource1. If you are on tab2, it still is just moving through the master
records on tab1 and refreshing the grid on tab2.
"Ernesto Buenrostro" <ernesto...@hotmail.com> wrote in message
news:4302...@newsgroups.borland.com...
"Ron H" <rhe...@leavethisoutpearlrecovery.com> wrote in message
news:4304a746$1...@newsgroups.borland.com...
Ok. I'll describe my application
I have my navigations controls workin with Actions (dataset actions), I have
A TPageControl, I'm have two ClientDataSet, Because I'm working with SQL
Server, so I have DataControls In one TabSheet, and a Grid in the second
TTabSheet so when I change to the second tabsheet my constrol get disabled,
I haven't any code for onchange, click ... etc TPagecontrol Events ... it's
why I get so confused about that thing, any that I can see is tha if add a
control relate to the master table, this still enabled ... but if I delete
that, get disabled ... *-)
thanks for all
Ernesto Buenrostro
"Ron H" <rhe...@leavethisoutpearlrecovery.com> escribió en el mensaje
news:4304a8a5$1...@newsgroups.borland.com...
"Ernesto Buenrostro" <ernesto...@hotmail.com> wrote in message
news:4305...@newsgroups.borland.com...
I only have navigation controls for the master table, I don't need
navigation controls for the second table, my second tavle is only to show a
list
I don't need to change the data source
my contros are out of the TPageControl, they're in a toolbar
Thanks for your help.
Ernesto Buenrostro
"Ron H" <rhe...@leavethisoutpearlrecovery.com> escribió en el mensaje
news:43060719$1...@newsgroups.borland.com...
My suggestion would be to create a dummy onChanging event in for your
PageControl and put a breakpoint there and step through your code (F7) from
that point. Check to see if you are closing the Master dataset perhaps
(which would close the Master and gray out the controls without affecting
the detail grid on tab2) or maybe you are affecting the datasource somehow.
Example of a dummy event would be:
procedure TForm1.PageControl1Changing(Sender: TObject;
var AllowChange: Boolean);
begin
allowchange := true;
end;
"Ernesto Buenrostro" <ernesto...@hotmail.com> wrote in message
news:4306...@newsgroups.borland.com...
I do something like that, I put a button to get the state of the
ClientDataSet, And I get this Active=True, and in state = [dsBrowse]
this is so curiouse, like if I add a control linked to the dataset and the
navigation sistem Get to work ok. but If I Delete that control I go back and
get the navigation System Disabled ... :S, why?, I don't know, it's why I
ask if that is a property.
maybe I must to go and see the code of the controls to see what's happening
...
I started that system with ECO, but due the ide have a litle issues, I
desided go to Delphi VCL .Net, but I find other issues in .net, so Go back
to higly tested win32 architecture, but I get that issue, I would to go
pascal :S ... jejeje
thanks for all
don't worry for that thing, I'm thinking to write my own code for navigation
controls
Ernesto Buenrostro
"Ron H" <rhe...@leavethisoutpearlrecovery.com> escribió en el mensaje
news:43065dc1$1...@newsgroups.borland.com...
Anything not behaving that way is being caused by something in your code. I
will e-mail you if you would like to send me a sample of code to look at,
but I think we've belabored the point here enough :-).
Best of luck,
Ron
"Ernesto Buenrostro" <ernesto...@hotmail.com> wrote in message
news:4306...@newsgroups.borland.com...