Solved

Getting the last column in a tabpage

Posted on 2003-10-30
6
461 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
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

Free Tool: ZipGrep

ZipGrep is a utility that can list and search zip (.war, .ear, .jar, etc) archives for text patterns, without the need to extract the archive's contents.

One of a set of tools we're offering as a way to say thank you for being a part of the community.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
What is an NDK ? 3 102
eclipse luna javeEE perspecive missing 5 112
How can I build my own IDE using ASP.NET MVC? 2 53
Export all vba modules from outlook vbaproject.otm 7 30
Programmer's Notepad is, one of the best free text editing tools available, simply because the developers appear to have second-guessed every weird problem or issue a programmer is likely to run into. One of these problems is selecting and deleti…
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: …
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 new code templates in NetBeans IDE 8.0 for Windows.

790 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