How to identify the arguments required for the function GetColumnControl
From the help I can find
column
What values should I give for band index and Column key.
This how the recorder script comes
TableObject.SetCellData "0","CurrencyGuid","43219"
If I use TableObject.GetColumnControl("0;CurrencyGuid") , I am getting th error "Object required: 'GetColumnControl(...)'"
and if I use TableObject.GetColumnControl("1;CurrencyGuid") , I am getting the error,
Key not foundParameter name: key
How can I know the correct values for the Column Key,
Your first assumption of what the values for band and column were correct. You are getting the "Object required: ..." error because you are using the following notation:
SET colEditorControl = ...
Your GetColumnControl method call will return a value of -1 if the column in question does not have an EditorControl of some type specified. The value of -1, not being an object but a value type, is the reason for the error. Other than that it appears that you are calling the method correctly.
If you are looping through the columns some having editorControls and others not I would do a test somewhat like this:
SET grid = SwfWindow("Form1").SwfTable("ultraGrid1")colEditorControlValue = grid.GetColumnControl("nBandIndex;sColumnKey")IF colEditorControlValue <> -1 THEN SET colEditorControl = grid.GetColumnControl("nBandIndex;sColumnKey") ...END IFI hope this answers your question,
Hi Mike,
This is not working.
When I pass bandIndex as 0 it doent return anything. not even -1
If I use band index as 1 the I get th error
"Index was out of range. Must be non-negative and less than the size of the collection.Parameter name: index"
Pls let me know how to proceed.
Actually in looking at it further the value -1 may be version specific, there were changes in the error reporting in version 8.1 of TestAdvantage. These changes may have changed the return value for when an exception is caught.
What version of NetAdvantage/TestAdvantage are you using?
Regardless of the version though it should still return a constant value for the error value, by the sounds of it, by your inability to use SET, it is a value type, and as such you can do a simple comparison test first, just to a different value.
I alluded to it before, in that you must have an EditorControl for GetColumnControl to work. Now granted this does make the assumption that you are working close enough with your developers to know which columns editors use a external control. But the previously stated test will let you know if it was defined or not.
As an aside a valuelist is a collection and not a control in and of itself, and therefore would not be picked up from GetColumnControl.
I hope this answers your question,
Another information I got is GetColumnControl will not work for list boxes which are populated using value list.
is this information correct.
For the benefit of the forum users, can you pls share the details where this method will word and where it will not work.
It should work exactly like I sent you previously, just with a different compare value, so instead of testing -1, test and empty string.
SET grid = SwfWindow("Form1").SwfTable("ultraGrid1")colEditorControlValue = grid.GetColumnControl("nBandIndex;sColumnKey")IF colEditorControlValue <> "" THEN SET colEditorControl = grid.GetColumnControl("nBandIndex;sColumnKey") ...END IF
Hi Mike ,
I am using Test Advantage Version 7.3CLR2.0
basically its returning a Nothing/ Blank value. because of which I am getting the error.
What could be a possible alternative?
band index will be 0 for the normal grids , right?