Would like to know if this is the right way of retrieving user work-list, and if yes what is it i am doing wrong because its not binding it to the gridview
Thank you in advance
Ntshengedzeni
Hi,
You did not include any code so I cannot say what could be the problem.
However, here is a sample which populates a Gridview on a page. It uses the SourceCode.Workflow.Client API:
Connection con = new Connection();
try
{
con.Open("dlx:5252"); // Open connection to the server
SourceCode.Workflow.Client.Worklist wlist = con.OpenWorklist(); // Open the worklist
GridView1.DataSource = wlist; // Set the Gridview data source
GridView1.DataBind(); // Databind the Gridview
}
catch (Exception ex)
{
throw ex;
}
finally
{
if (con != null) // Cleanup the connection
{
con.Close();
con.Dispose();
}
con = null;
}
I hope this helps!
Regards,
I am new to K2 aznd i am really learning a lot, i saw there are so many databases that K2 Blackpearl uses, and what database do i neet to connect to to cen ted this information, Data, ID, Activity Name and Folio
Thank you in advance
Ntshengedzeni
Hi,
It is not recommended to query the K2 databases directly.
However all the data you are looking for are exposed through the API. In the code above create a ForEach loop from the worklist which was returned and loop through each of the WorklistItems. Each WorklistItem object has all the necessary properties.
Hope this helps!
Please advice if i am missing something
Thank you in advance
Ntshengedzeni
Hi,
If you can get your hands on the Professional K2 blackpearl book, a code example is provided to achieve just this. Look on page 429 to find the example. I cannot copy the code here, but in short you will do the following to get the data:
- Create a DataTable object.
- Add all the columns you need to the DataTable.
- Create a foreach loop to loop through all the worklist items.
- For each worklist item returned create a new DataRow.
- Set the columns for each individual row.
- When all the columns for this worklist item is set, add the row to the data table.
- Outside of the foreach loop set the Gridview's data source to the data table.
- Databind the Gridview.
Using the above steps you will find that all the data is available.
I would strongly suggest that you get a copy of the Professional K2 blackpearl book, published by Wrox as this will help you a lot with queries like this. (ISBN: 978-0-470-29305-8)
Regards,
Thank you very much, i managed to get it with your Suggestions.
Regards
Ntshengedzeni
Reply
Enter your E-mail address. We'll send you an e-mail with instructions to reset your password.