Hello,
I have created a sample project that demonstrates an issue i am having when adding rows to a child band at runtime. I am attempting to load text that a user types into a form i created, and to analyze the amount of text so i only have 5 lines per cell, and the the rest of the text will be put into a newly created row.
Please run the sample, and then when you click on a child bands cell to get my form to load up. paste the following text in there, and click the OK button:
This is a test of sentence one. And this is more text for sentence one.
This is a test of sentence two.
This is a test of sentence three.
This is a test of sentence four.
This is a test of sentence five.
This is a test of sentence six.
It appears to add the rows just fine, but it seems now that you can't get the cell to go back into edit mode unless you click on a different row and then back on the bottom row of the band. Also, it appears some of the text in the first row is selected.
I would like it so after i create the rows, if i click on either of those edited rows again, my form comes up. Please let me know if there is any confusion, but the sample should demonstrate what is going on.
-Chris
I took a quick look at this and the problem is that you are doing things in the BeforeEnterEditMode event handler that you shouldn't be doing, like clearing the ActiveCell and adding new rows. When execution returns from the BeforeEnterEditMode event, the grid expects the ActiveCell to be set to something and if it isn't the results will be unpredictable. I'm afraid I was not able to fully grasp what the code in the BeforeEnterEditMode handler is trying to accomplish, but my guess is you just have to execute it in response to some other trigger.
Brain,
Thanks for your response. I moved my code into the after cell activate event, and now it works great.
In the BeforeEnterEditMode event, I was attempting to break up the text that the user enters into no more than 5 lines each cell, and if there is more than five lines, add more rows so that there is only up to 5 lines of text in each row. This is because there is no free scrolling functionality, so if there is large amounts of text typed in, then some of it will not be visible on screen. If i break the text up into no more that 5 lines of text, then the user should have no problem seeing all of thier entered text.
Thanks again for your help