|
The following is an example of how to use WFDataGrid:
protected Ascentn.Workflow.WebControls.WFDataGrid WFDataGrid1;
private void ButtonShowProcess_Click(object sender, System.EventArgs e)
{
// query all process instances for selected process template
string sql = string.Format("select PROC_INST_NAME, STATUS, LAST_MODIFIED_BY, LAST_MODIFIED_DATE, STARTED_DATE, DUE_DATE, COMPLETED_DATE from WF_PROC_INSTS where DEF_NAME='{0}'", WFProcessTemplateDropDownList2.SelectedItem.Text.ToString() );
string xml = this.GetAPI().QueryDatabase(sql);
DataSet d = new DataSet();
System.IO.StringReader sr = new System.IO.StringReader(xml);
System.Xml.XmlTextReader xr = new System.Xml.XmlTextReader(sr);
if (xml != "<DataSet />")
{
d.ReadXml( xr );
}
else
{
d = null; //reset the datasource and DataGrid
}
xr.Close();
WFDataGrid1.DataSource = d;
WFDataGrid1.DataBind();
} |