Hi I am sorry to open a new topic for this problem, but we were not getting any reply for the old post opened by Ms. Shilpa.
Guys, I need to click on a check box inside an ultragrid, but I am unable to check it.
I have tried SetCellData, i have also tried to select the cell and sending Space keys using WScript.Shell, but even that doesn't work for me.
Could you pelase give us a workaround, as I am stuck at this point.
Please its very urgent for me.
Thanks Michael
Hi Amit,
I think you would be best served working with one of our Developer Support Engineers, as they would be able to look deeper into this issue than I could through this forum. I will forward this onto them for you and they should contact you directly in one business day.
Hi Michael,
Thanks for all your help, I have tried setting the cell data using: True, "True"
but still I am receiving the same error:
Error Message: Specified cast is not valid.
The error is coming at
Infragistics.Win.UltraWinGrid.UltraGrid.OnBeforeCellUpdate(BeforeCellUpdateEventArgs e)
Code Used:
SwfWindow("Search").SwfWindow("Adjustment").SwfTable("ultraGrid_2").ActivateRow "2"SwfWindow("Search").SwfWindow("Adjustment").SwfTable("ultraGrid_2").SelectRow "2"SwfWindow("Search").SwfWindow("Adjustment").SwfTable("ultraGrid_2").ActivateCell "2","IsPartOf"SwfWindow("Search").SwfWindow("Adjustment").SwfTable("ultraGrid_2").SelectMultiple "","",""SwfWindow("Search").SwfWindow("Adjustment").SwfTable("ultraGrid_2").SetCellData "2","IsPartOf","True"
And
SwfWindow("Search").SwfWindow("Adjustment").SwfTable("ultraGrid_2").ActivateRow "2"SwfWindow("Search").SwfWindow("Adjustment").SwfTable("ultraGrid_2").SelectRow "2"SwfWindow("Search").SwfWindow("Adjustment").SwfTable("ultraGrid_2").ActivateCell "2","IsPartOf"SwfWindow("Search").SwfWindow("Adjustment").SwfTable("ultraGrid_2").SelectMultiple "","",""SwfWindow("Search").SwfWindow("Adjustment").SwfTable("ultraGrid_2").SetCellData "2","IsPartOf",True
SwfWindow("Search").SwfWindow("Adjustment").SwfTable("ultraGrid_2").SetCellData "2","IsPartOf","True"
I believe there may be something else that I am missing, as I just tested a normal checkbox with a Boolean column, and it works fine with a string value of both "True" and "False". So I am not sure what you are hitting specifically. But I would suggest that you try removing the quotes, around "True" and "False", and just send in the Boolean values of True and False. Let me know if that works for you.
I ran the code procided by you, here is the output for required column;
Column [IsPartOf] - System.Boolean
so, even though the datatype is boolean, the setdata gets recorded as string:
SwfWindow("Search").SwfWindow("Adjustment for").SwfTable("ultraGrid").SetCellData "1","IsPartOf","True"
Could you plese advise me, what am I supposed to do?