Hi,
I have sfDataGrid where I have added an unbound column called "Volume"
//add unbound columns
pipeDataSfDataGrid.Columns.Add(new GridUnBoundColumn()
{
HeaderText="Volume (m3)",
MappingName="Volume",
Width=75
});
I am using the QueryUnboundColumnValue event to populate the column values like this
private void pipeDataSfDataGrid_QueryUnboundColumnValue(object sender, GridUnboundColumnEventsArgs e)
{
if (e.UnBoundAction==UnBoundActions.QueryData)
{
switch (e.Column.MappingName)
{
case "Volume":
var size = Convert.ToInt32(e.Record.GetType().GetProperty("PipeDataSizeID").GetValue(e.Record));
var length = Convert.ToDouble(e.Record.GetType().GetProperty("PipeDataLength").GetValue(e.Record));
e.Value = CalculateVolume(size, length);
break;
}
}
}
Also in CurrentCellEndEdit event I am forcing to invoke the QueryUnboundColumnValue() event by using UpdateUnboundColumn like this
private void pipeDataSfDataGrid_CurrentCellEndEdit(object sender, CurrentCellEndEditEventArgs e)
{
var recordindex = pipeDataSfDataGrid.ResolveToRecordIndex(e.RowColumnIndex.RowIndex);
var record = pipeDataSfDataGrid.View.Records.GetItemAt(recordindex);
pipeDataSfDataGrid.UpdateUnboundColumn(record, "Volume");
}
everytime the UpdateUnboundColumn is fired it does not invoke the QueryUnboundColumnValue() event.
I need to know if I have not set up something that prevents me from population my unbound column.
I have attached source code
Attachment:
Piping_26cce7a7.zip