Home › Forums › WinForms controls › Xceed Grid for WinForms › properties for parent grid
-
AuthorPosts
-
#14412 |
hi,
i am finding a way to know if my current selected row is in parent grid or not.
i have this line of code:
mGrid = s.get_CurrentRow().get_parentgrid().ParentDataRow
which should return null meaning my current row is in the parentgrid. but when i ran the code above, it throws an exception error.
so, i tried to do this:
if isnull(s.get_CurrentRow().get_parentgrid().ParentDataRow) then
code1
else
code2
end ifthe above doesn’t throw an exception error but instead of going to code1 (as the object is null) it goes to my else statement.
any other way to know that my current row is the parent grid?
thanks.
~amberrv~
p.s.
am using testcomplete to record scripts and the above line of code will help me expand a treeview inside the grid. not sure if am making any sense.. but still, hope anyone can help me..Imported from legacy forums. Posted by amberrv (had 2808 views)
Verify that the row has a parent grid but that parent grid has no parents :
if( ( row.ParentGrid != null ) && ( row.ParentGrid.ParentGrid == null ) )
{
// Row is in root grid.
}Imported from legacy forums. Posted by Vince [Xceed] (had 303 views)
hi, isn’t that what my code does?
it checks if the current row is the root grid. if returns null then it means it is else goes to my else statement.
i don’t know why but the script above doesn’t recognize that the object is null that’s why i can’t get it to go to the next line of code.
thanks!
btw, am using vbscript so if ever, please do the scripts using it? ta again!
Imported from legacy forums. Posted by amberrv (had 321 views)
I’m a little confused about your question, the code mentioned above by Vince should have worked fine to determine if the row is indeed in the “root” grid. Can you send us details about the environment you are using along with the version of your Xceed.Grid.Dll? Please send us the details here :
http://www.xceedsoft.com/support/form.asp
We will be able to investigate further with more details.
Imported from legacy forums. Posted by Matt (had 3924 views)
-
AuthorPosts
- You must be logged in to reply to this topic.