Solved

Getting the last column in a tabpage

Posted on 2003-10-30
6
471 Views
Last Modified: 2013-12-26
I need to findout the last column in the datawindow on a tabpage. Across the tabs I am having one datawindow control and based on the conditions, I am changing the property of the column to make it visible. In such a situation, is it possible to  get the last column in the current  tabpage.
Thanks in advance
0
Comment
Question by:balakarthikeyan
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
6 Comments
 
LVL 15

Expert Comment

by:namasi_navaretnam
ID: 9656977
Bala, Here is an example

datawindow ldw
long            ll_countcount
string          ls_modify
or
u_dw   ldw  // if PFC

ldw= tab_1.tabpage_last.dw_1

ll_colcount = long(ldw.Describe("DataWindow.Column.Count"))
ls_modify = "#" + string(ll_colcount) + ".Width='200'"
ldw.Modify(ls_modify)

You can do tha same for other properties as well.

Another example,

ls_modify = "#" + string(ll_colcount) + ".Edit.Limit=50"
ldw.Modify(ls_modify)

HTH

Namasi Navaretnam
0
 
LVL 8

Expert Comment

by:Vikas_Dixit
ID: 9657651
Hi,

It seems, you want to get the rightmost visible column in the datawindow. If so,
then you may need to look into the 'X' property of the column:
li_MaxX =0
ll_MaxXCol = 1
ll_colcount = long(ldw.Describe("DataWindow.Column.Count"))
for ll_count = 1 to ll_colcount
           ls_describe = "#" + string(ll_count) + ".visible"
           ls_visible = ldw.describe(ls_describe)
           if ls_visible = '1' then //
                li_X = Integer (ldw.describe("#" + string(ll_count) + ".X"))
                if li_MaxX > li_X then
                      ll_MaxXCol = ll_count
                      li_MaxX = li_X
                end if
            end if
next

Messagebox("Rightmost Col " , ldw..Describe("#" + string(ll_MaxXCol) + ".Name"))

Hope this helps,
Regards,
Vikas D
0
 
LVL 1

Expert Comment

by:srikanth_a
ID: 9682877



1)  Control[]     array will give you the list of controls in a window.

2)  tab_1.control[] will give you the number of tabpages.

3) tab_1.tabpage_1.control[] should give you the number of controls on a tabpage.

Declare one variable each for every type of object in the tabpage.

check the type of control which is the last control on the array. (UpperBound will get you the number)

Assign the control to the variable.  use the classname() function to get the name.
 
Srikanth
0
 

Author Comment

by:balakarthikeyan
ID: 9815967
The above comments / solutions will work if the datawindow is associated with the tabpage. Here the senario is different. The datawindow control is not associated with any tabpages. We have single datawindowcontrol acrross the tabpages. The tabpages are created dynamically at runtime based on some condition and the property of the columns in the datawindow also changed dynamically to display the related the informations.

I have achieved it by using instance variable. So, I want to close this question. Also I request you to refund the points.
0
 

Accepted Solution

by:
AnnieMod earned 0 total points
ID: 9910891
A request has been made in Community Support to close this question:

http://www.experts-exchange.com/Community_Support/Q_20821503.html

If there are no objections, a moderator will finalise this question after 72 hours by:

- Deleting the question and refunding points

Please leave any recommendations here.

AnnieMod
Community Support Moderator
0

Featured Post

Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

In our object-oriented world the class is a minimal unit, a brick for constructing our applications. It is an abstraction and we know well how to use it. In well-designed software we are not usually interested in knowing how objects look in memory. …
How to install Selenium IDE and loops for quick automated testing. Get Selenium IDE from http://seleniumhq.org Go to that link and select download selenium in the right hand column That will then direct you to their download page. From that p…
The viewer will learn how to use NetBeans IDE 8.0 for Windows to connect to a MySQL database. Open Services Panel: Create a new connection using New Connection Wizard: Create a test database called eetutorial: Create a new test tabel called ee…
The viewer will learn how to use and create keystrokes in Netbeans IDE 8.0 for Windows.
Suggested Courses

623 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question