You need to update the Content property with an XML string as follows:
ItemFields Fields = new ItemFields(component.Content, component.Schema); SingleLineTextField textField = (SingleLineTextField)Fields["size"]; textField.Value = "blabla..."; component.Content = Fields.ToXml();
source share