Your Privacy Matters: We use our own and third-party cookies to improve your experience on our website. By continuing to use the website we understand that you accept their use. Cookie Policy
860
Setting the active cell on adding of row
posted

Hi,

     I am adding a row.  I have a function that i call to validate the data in that row.  If it fails, it should active the offending cell.  When i do this, it appears not to get focus.  How do i fix this.  

I have my RowAdding Event as follows

 

 

 

 

 

 

 

 

function

 

 

wdgQuestionare_Editing_RowAdding(sender, eventArgs) {

 

 

 

 

 

 

var row = eventArgs.get_row();

var isNotValid = Validate(row, sender);

eventArgs.set_cancel(isNotValid);

}

My Validate function:

 

function

 

 

Validate(row, grid) {

var cell = row.get_cellByColumnKey(

 

'QUESTION_ID');

var value = cell.get_value();

 

 

 

if (value == null || value == 0 || value == -1) {

   grid.get_behaviors().get_activation().set_activeCell(cell);

 

 

   return true;

}

What appears to be the problem,

Thanks,

}

Parents
No Data
Reply
  • 2677
    posted

    Hello,

    What version of NetAdvantage are you using?  I tried your exact code in a sample project using 10.3  and it worked fine.  I am not sure without debugging your sample to see what the problem is.  I have attached my sample project.  Please run it in your version and see if the problem persists.  If not, pleas try to modify my sample to reproduce the problem and send it back to me so I can take a look.  I removed the Ig_res folder to make the size small enough to fit as an attachment.  Just add that back to the project when it gets to you.

    I hope this helps.

    WebDataGrid_RowAdding.zip
Children
No Data