You can override Column.OnCellClick to pre-fill datta in node cell:
[C#]
public class PreFilledColumn : Column
{
public PreFilledColumn() : base(){}
public PreFilledColumn(string name) : base(name){}
public PreFilledColumn(string name, string fieldName) : base(name, fieldName){}
public override bool OnCellClick(FlyGrid grid, NodeBase node, Point clickPt)
{
object value = this.GetValue(node);
if (value == null || value == System.DBNull.Value || value.Equals(string.Empty))
{
//pre fill cell data
this.SetValue(node, GetPreFilledData(node));
}
return base.OnCellClick(grid, node, clickPt);
}
private object GetPreFilledData(NodeBase node)
{
return DateTime.Today;
}
}
Or you can give the user possiblity to enter or cancel input of data by setup inplace editor:
[C#]
public class PreFilledColumn : Column
{
public PreFilledColumn() : base(){}
public PreFilledColumn(string name) : base(name){}
public PreFilledColumn(string name, string fieldName) : base(name, fieldName){}
protected override void OnEditorSetup(TextBox editor)
{
base.OnEditorSetup (editor);
if (editor.Text == string.Empty)
{
//pre fill data in the inplace editor
editor.Text = GetPreFilledData();
}
}
private string GetPreFilledData()
{
return DateTime.Today.ToString();
}
}