0 Replies Latest reply on Jun 8, 2007 3:28 AM by Vyshak

    DataGrid ItemEdit Validation

    Vyshak Level 1
      Hi all,

      I have an application with datagrid inline editing functionality. I have a custom item renderer for all the columns and i have to perform validations also on the user entered data. The itemEditEnd function goes like this,

      private function editCell(event:DataGridEvent ) : void
      {
      if( event.reason == DataGridEventReason.CANCELLED) {
      return;
      }

      var oldValue:String = event.currentTarget.editedItemRenderer.data[event.dataField];
      var newValue:String = TextInput(event.currentTarget.itemEditorInstance).text;
      if(newValue == "") {

      event.preventDefault();
      TextInput(dg.itemEditorInstance).errorString ="Enter a valid string.";
      return;
      }

      }

      typical ex from Adobe.
      It works fine and shows the error string in the exact edited text box inside Grid.
      But Once i integrate wit the DB with DMS call and tried to edit, the error message is shown at a random place, say on top of the page.
      please help me out to solve this.
      thanks in advance