Solved

Getting the last column in a tabpage

Posted on 2003-10-30
6
453 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
6 Comments
 
LVL 15

Expert Comment

by:namasi_navaretnam
Comment Utility
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
Comment Utility
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
Comment Utility



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
Comment Utility
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
Comment Utility
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

Enabling OSINT in Activity Based Intelligence

Activity based intelligence (ABI) requires access to all available sources of data. Recorded Future allows analysts to observe structured data on the open, deep, and dark web.

Join & Write a Comment

Update (December 2011): Since this article was published, the things have changed for good for Android native developers. The Sequoyah Project (http://www.eclipse.org/sequoyah/) automates most of the tasks discussed in this article. You can even fin…
Here is a helpful source code for C++ Builder programmers that allows you to manage and manipulate HTML content from C++ code, while also handling HTML events like onclick, onmouseover, ... Some objects defined and used in this source include: …
This tutorial covers a step-by-step guide to install VisualVM launcher in eclipse.
THe viewer will learn how to use NetBeans IDE 8.0 for Windows to perform CRUD operations on a MySql database.

763 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

Need Help in Real-Time?

Connect with top rated Experts

12 Experts available now in Live!

Get 1:1 Help Now