Hi Martin,

    That's works I have just replaced the wrong widget with tdbstringedit and 
set it's datalink.fieldname as ftlookup. Excuse me for the inconvenience.

Nb: what do you mean by sortcol = n when we have multiple columns to sort?

Best Regards

Med
________________________________________
De : Martin Schreiber [mse00...@gmail.com]
Envoyé : lundi 24 octobre 2016 09:24
À : mseide-msegui-talk@lists.sourceforge.net
Objet : Re: [MSEide-MSEgui-talk] TDBstringLookupLb

On Monday 24 October 2016 09:29:56 mohamed hamza wrote:
> Hi Martin,
>
>     Thanks for your advice. Now the column is sorted , But when I click on
> heading arrow this one becomes unsorted instead desc sort and I can not
> return back to sorted column?
>
Works for me, please send an example with tlocaldataset or tsqlite3connection
which shows the problem.

>  Note: I can not set optionsgrid.og_sorted to true?
>
This probably is OK, tdbgrid can not be internally sorted because it has rows
for the visible range of records only -> it removes og_sorted from
optionsgrid.

"
procedure tcustomdbwidgetgrid.setoptionsgrid(const avalue: optionsgridty);
begin
 inherited setoptionsgrid(fdatalink.updateoptionsgrid(avalue));
end;

function tgriddatalink.updateoptionsgrid(const avalue: optionsgridty):
optionsgridty;
begin
 result:= avalue - [og_sorted];
 with tcustomgrid1(fgrid) do begin
  if og_sorted in avalue then begin
   if not (gs1_dbsorted in fstate1) then begin
    include(fstate1,gs1_dbsorted);
    invalidate;
   end
  end
  else begin
   if gs1_dbsorted in fstate1 then begin
    exclude(fstate1,gs1_dbsorted);
    updatesortfield(nil,false);
    invalidate;
   end;
  end;
 end;
end;
"

Martin

------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, SlashDot.org! http://sdm.link/slashdot
_______________________________________________
mseide-msegui-talk mailing list
mseide-msegui-talk@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/mseide-msegui-talk

------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most 
engaging tech sites, SlashDot.org! http://sdm.link/slashdot
_______________________________________________
mseide-msegui-talk mailing list
mseide-msegui-talk@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/mseide-msegui-talk

Reply via email to