Editable grid view - Text auto complete crasing update record

Record update in editable grid view gives sql error when there is text autocomplete field (lookup). The error is about wrong characters.
Probably Autocomplete tries to put characters into the foreign key field or something.