DataBind Claude Compliance Data to the DevExpress Data Grid

Jerod Johnson
Jerod Johnson
Director, Technology Evangelism
Use the CData ADO.NET Provider for Claude Compliance with the DevExpress Windows Forms and Web controls to provide Claude Compliance data to a chart.

The CData ADO.NET Provider for Claude Compliance incorporates conventional ADO.NET data access components compatible with third-party controls. You can adhere to the standard ADO.NET data binding procedures to establish two-way access to real-time data through UI controls. This article will demonstrate the utilization of CData components for data binding with DevExpress UI Controls (Windows Forms and Web controls), specifically binding to a chart that visualizes live data.

The driver connects to Claude Compliance using a Compliance Access Key, the only supported authentication method. Set the following connection property:

  • APIKey: The Compliance Access Key you created.

Creating a Compliance Access Key

  1. Enable the Compliance API for your organization.
  2. Sign in to claude.ai as a primary owner or organization owner and open Organization settings > API > Keys.
  3. Select Create Key and assign only the scopes your integration needs:
    • read:compliance_activities for Activities and the typed activity views.
    • read:compliance_org_data for organizations, roles, groups, and settings.
    • read:compliance_user_data for users, chats, files, projects, and downloads.
    • delete:compliance_user_data for the explicit Delete stored procedures.
  4. Create the key and copy it when it appears. The key starts with sk-ant-api01- and is shown only once.

Optionally, set OrganizationUUID to limit organization-scoped views (such as OrganizationUsers and ComplianceRoles) to a single linked organization. If it is left empty, those views default to the first available organization and do not include data from all linked organizations.

Windows Forms Controls

The code below shows how to populate a DevExpress chart with Claude Compliance data. The ClaudeComplianceDataAdapter binds to the Series property of the chart control. The Diagram property of the control defines the x- and y-axes as the column names.


using (ClaudeComplianceConnection connection = new ClaudeComplianceConnection(
"APIKey=your_compliance_access_key;")) {
  ClaudeComplianceDataAdapter dataAdapter = new ClaudeComplianceDataAdapter(
  "SELECT Id, Name FROM Projects WHERE OrganizationUuid = 'abcdef01-2345-6789-abcd-ef0123456789'", connection);
  
  DataTable table = new DataTable();
  dataAdapter.Fill(table);
  DevExpress.XtraCharts.Series series = new DevExpress.XtraCharts.Series();
  chartControl1.Series.Add(series);
  series.DataSource = table;
  series.ValueDataMembers.AddRange(new string[] { "Name" });
  series.ArgumentScaleType = DevExpress.XtraCharts.ScaleType.Qualitative;
  series.ArgumentDataMember = "Id";
  series.ValueScaleType = DevExpress.XtraCharts.ScaleType.Numerical;
  chartControl1.Legend.Visibility = DevExpress.Utils.DefaultBoolean.False;
  ((DevExpress.XtraCharts.SideBySideBarSeriesView)series.View).ColorEach = true;                              
}
The complete code example and the resulting chart.

Web Controls

The code below shows how to populate a DevExpress Web control with Claude Compliance data. The ClaudeComplianceDataAdapter binds to the Series property of the chart; the Diagram property defines the x- and y-axes as the column names.


using DevExpress.XtraCharts;

using (ClaudeComplianceConnection connection = new ClaudeComplianceConnection(
"APIKey=your_compliance_access_key;"))
{
  ClaudeComplianceDataAdapter ClaudeComplianceDataAdapter1 = new ClaudeComplianceDataAdapter("SELECT Id, Name FROM Projects WHERE OrganizationUuid = 'abcdef01-2345-6789-abcd-ef0123456789'", connection);
  DataTable table = new DataTable();
  ClaudeComplianceDataAdapter1.Fill(table);
  DevExpress.XtraCharts.Series series = new Series("Series1", ViewType.Bar);
  WebChartControl1.Series.Add(series);
  series.DataSource = table;
  series.ValueDataMembers.AddRange(new string[] { "Name" });
  series.ArgumentScaleType = ScaleType.Qualitative;
  series.ArgumentDataMember = "Id";
  series.ValueScaleType = ScaleType.Numerical;
  ((DevExpress.XtraCharts.SideBySideBarSeriesView)series.View).ColorEach = true;
}
An ASP.NET application created with the ADO.NET Provider and the DevExpress Web Forms control. (Salesforce is shown.)

Ready to get started?

Download a free trial of the Claude Compliance Data Provider to get started:

 Download Now

Learn more:

Claude Compliance Icon Claude Compliance ADO.NET Provider

Rapidly create and deploy powerful .NET applications that integrate with Claude Compliance data including Activities, Chats, ChatMessages, CodeArtifacts, ComplianceRoles, Organizations, OrganizationUsers, Projects, and more!