Dear community,
I face a problem in the representation of a TeeGrid with two left-side fixed columns. If I click on a editable field (only selected) and then scroll horizontally, then the selected field is drawn over the fixed columns until it leaves the canvas.
So my questions are:
a) How can I keep the row selected but with unselected cell?
b) How can I unedit a cell programmatically?
Any suggestions are highly appreciated.
Thank you very much!
TeeGrid cell edit and scrolling with fixed columns
Re: TeeGrid cell edit and scrolling with fixed columns
Hello,
Re. (a)
I'm not sure that you can select a row without a cell being implicitly selected. TeeGrid starts with the zero,zero location cell selected. If you were to add this code for example, it indicates the row selected:
You could define the mySelected variable with a wider scope or as a variable to take your required selection and use it to set a selected cell/row;
eg.
For more specific information on setting a selected col/row see the Cell Editors example:
https://github.com/Steema/TeeGrid-VCL-F ... %20Editors
Re. b) How can I unedit a cell programmatically?
I think I don't understand the objective. If it's to undo a change then you'll need to code that yourself, taking a backup of content before an edit to later roll-back to if required. Please clarify if I've misunderstood,
Regards,
Marc Meumann
Re. (a)
I'm not sure that you can select a row without a cell being implicitly selected. TeeGrid starts with the zero,zero location cell selected. If you were to add this code for example, it indicates the row selected:
Code: Select all
uses Tee.Grid.Selection
procedure TFormLocked.TeeGrid1Select(Sender: TObject);
var mySelected : TGridSelection;
begin
mySelected := TVCLTeeGrid(Sender).Selected;
showmessage(IntToStr(mySelected.Row));
end;
eg.
Code: Select all
procedure TFormLocked.Button1Click(Sender: TObject);
begin
TVCLTeeGrid(Sender).Selected := mySelected;
end;
https://github.com/Steema/TeeGrid-VCL-F ... %20Editors
Re. b) How can I unedit a cell programmatically?
I think I don't understand the objective. If it's to undo a change then you'll need to code that yourself, taking a backup of content before an edit to later roll-back to if required. Please clarify if I've misunderstood,
Regards,
Marc Meumann
Steema Support