• CXGRID,定位并高亮


    var
      I, FoundPos: integer;
      AColumn : TcxGridDBColumn;
      AText : String;
    begin
      AText := 'Blue Sports';
      with cxGrid1DBTableView1 do
      begin
        AColumn := GetColumnByFieldName('Company');
        for I := 0 to ViewData.RecordCount - 1 do
          if ViewData.Rows[I].IsData then
          begin
            ViewData.Rows[I].Focused := True;
            with Controller.EditingController do
            begin
              ShowEdit(AColumn);
              FoundPos := TcxRichEdit(Edit).FindText(AText, 0, Length(TcxRichEdit(Edit).Text), [stMatchCase]);
              if not (FoundPos < 0) then
              begin
                TcxRichEdit(Edit).SelStart := FoundPos;
                TcxRichEdit(Edit).SelLength := Length( AText);
                SendMessage(TcxRichEdit(Edit).InnerControl.Handle,EM_SCROLLCARET, 0, 0);
                Break;
              end
              else
                AColumn.Editing := False;
            end;
          end;
       end;
    end;

    直接摘的代码,原文出处:

    http://www.devexpress.com/Support/Center/p/B3656.aspx?searchtext=Allow

  • 相关阅读:
    uva11552
    zoj3820 树的直径+二分
    hdu 5068 线段树加+dp
    zoj3822
    uva1424
    DAY 36 前端学习
    DAY 35 前端学习
    DAY 34 PYTHON入门
    DAY 33 PYTHON入门
    DAY 32 PYTHON入门
  • 原文地址:https://www.cnblogs.com/rayz/p/2913762.html
Copyright © 2020-2023  润新知