Getting the last column in a tabpage

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
balakarthikeyanAsked:
Who is Participating?

[Product update] Infrastructure Analysis Tool is now available with Business Accounts.Learn More

x
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

namasi_navaretnamCommented:
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
Vikas_DixitCommented:
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
srikanth_aCommented:



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
balakarthikeyanAuthor Commented:
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.
AnnieModCommented:
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

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Editors IDEs

From novice to tech pro — start learning today.