Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 987439
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 16, 20262026-05-16T05:28:32+00:00 2026-05-16T05:28:32+00:00

I use a TcxExtLookupComboBox from Devexpress and try to implement a custom datasource. I

  • 0

I use a TcxExtLookupComboBox from Devexpress and try to implement a custom datasource. I have set the customdatasource like this:

procedure TMainForm.FormCreate(Sender: TObject);
begin
  fDataSource := TMyDataSource.Create;
  cbotestSearch.Properties.View.DataController.CustomDataSource := fDataSource;
end;

TMyDataSource is defined here:

unit Datasource;

interface

uses
  Classes,
  IBQuery,
  SysUtils,
  cxCustomData;

type
  TSearchItem = class
    private
      BoldID: String;
      Display: String
  end;

  TMyDataSource = class(TcxCustomDataSource)
  private
    fSearchList: TList;
  protected
    function GetRecordCount: Integer; override;
    function GetValue(ARecordHandle: TcxDataRecordHandle; AItemHandle: TcxDataItemHandle): Variant; override;
  public
    constructor Create;
    destructor Destroy; override;
    procedure GetData;
  end;

implementation

constructor TMyDataSource.Create;
begin
  inherited Create;
  fSearchList := TList.Create;
end;

destructor TMyDataSource.Destroy;
begin
  FreeAndNil(fSearchList);
  inherited;
end;

procedure TMyDataSource.GetData;
var
  vItem: TSearchItem;
begin
  fSearchList.Clear;

  vItem := TSearchItem.Create;
  vItem.BoldID  := '1000';
  vItem.Display := 'test';
  fSearchList.Add(vItem);

  vItem := TSearchItem.Create;
  vItem.BoldID  := '1100';
  vItem.Display := 'test2';
  fSearchList.Add(vItem);

  DataChanged;    // Don't do anything as provider is nil
end;

function TMyDataSource.GetRecordCount: Integer;
begin
  // Is never entered
  Result := fSearchList.Count;
end;

function TMyDataSource.GetValue(ARecordHandle: TcxDataRecordHandle;
  AItemHandle: TcxDataItemHandle): Variant;
begin
  // Is never entered
  Result := 'Test';
end;

end.

The problem is that TMyDataSource.GetValue is never called. Any hint how to fix ?

Update 1: I have another hint here. If I single step in the DataChanged method that should cause GetValue to be called is looks like this:

procedure TcxCustomDataSource.DataChanged;
begin
  if Provider = nil then Exit;

  // Code using Provider
end;

and Provider is nil in this case. But I have assigned the Datasource in Forms oncreate as you see.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-16T05:28:33+00:00Added an answer on May 16, 2026 at 5:28 am

    cxExtLookupComboBox can only work with DB~views. Such views cannot accept instances of the TcxCustomDataSource object as a DataSource. So, your code will not work :-(. There is a suggestion to implement this feature in the future and it is registered at:

    http://www.devexpress.com/Support/Center/ViewIssue.aspx?issueid=AS10025

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Use trap to capture signals like this: i=-1;while((++i<33)); do trap echo $i >> log.txt
use grep command to find txt files containing telephone number. telephone number format could
Use: The user searches for a partial postcode such as 'RG20' which should then
Use http://jobs.sitesixteen.com/ for reference. I'm using YQL for the city, state auto-complete. IF you
use strict; use warnings; my $newPasswd = 'abc123'; my @lines = ( pwd =
I use the SetWindowPos api to make my window topmost with the HWND_TOPMOST param.
I use a C++ DLL in my app. type Tcl_bla = function(filename: PChar): Integer;
I use tomcat 7, deployed there a web application with jpa and hibernate. What
I use richfaces in my project and particularly the tag rich:modalPanel which allows to
I use: netbeans 6.9.1, tomcat 5.5.33, 7.0 and 6.x.x(inbuild-netbeans), java 1.6.23(both jdk and jre).

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.