Anachronox Posted January 25, 2013 Posted January 25, 2013 Since there's no SelectedIndex property on TUniDBGrid, how to change active (selected) grid column (cell) in runtime ? I tried to call ExtJS tweak: UniSession.AddJS('Form.Grid.getView().focusCell(3,3)'); but without success (no error, no action). Is there ANY solution how to control grid active column ? (Active Row is DataSet Current Record). Thanks a lot. Quote
Anachronox Posted January 31, 2013 Author Posted January 31, 2013 Nobody has an idea ? How to set grid active column ? Quote
mhmda Posted January 31, 2013 Posted January 31, 2013 I didn't understand your question? If your dbgrid connected to datasourse you may know the specific record by using the table properties. Quote
Anachronox Posted February 1, 2013 Author Posted February 1, 2013 Yes, the record is known. But i need to focus specific column (so to move grid cursor from one cell to another, within current record).In VCL there is SelectedIndex property on grid for this purpose,but in uniGUI I see no way... Quote
Asiaapollo Posted February 1, 2013 Posted February 1, 2013 You can create a inherited component, i.e. TUniExDBGrid = class( TUniDBGrid ); add one property "property Col: Integer read GetCol write SetCol;" and in implementation add below code: TUniExDBGrid = class( TUniDBGrid ) private function GetCol: Integer; procedure SetCol(Value: Integer); published property Col: Integer read GetCol write SetCol; Implementation function TUniExDBGrid.GetCol: Integer; begin Result := CurrCol-1; {-1 for CurrCol} end; procedure TUniExDBGrid.SetCol(Value: Integer); begin CurrCol:=Value+1; {+1 for CurrCol} end; It works for me, let me know whether it works for you or not. 2 Quote
Ronak Posted February 1, 2013 Posted February 1, 2013 One more option is using Hack unit Main; interface uses Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms, Dialogs, uniGUITypes, uniGUIAbstractClasses... . . type THackGrid = class(TUniDBGrid); type TMainForm = class(TUniForm) Grid1: TUniDBGrid; . . private { Private declarations } public { Public declarations } implementation procedure TMainForm.BitBtnmovecolClick(Sender: TObject); begin THackGrid(Grid1).CurrCol := newindex ; // Set the required columindex end; 1 Quote
Anachronox Posted February 1, 2013 Author Posted February 1, 2013 Thank you guys! Hidden property CurrCol works well.Maybe I'll help you other time.Cheers Quote
david_navigator Posted May 28, 2018 Posted May 28, 2018 What an odd property (CurrCol) to be protected. Has anything changed in this respect in the past 5 years ?I'm coming towards the end of my UniGUI evaluation - just the Grid to test and I'm finding it missing a lot of functionality compared to thge VCL grids I'm used to. Hopefully just the learning curve, rather than missing features. Quote
Administrators Farshad Mohajeri Posted May 29, 2018 Administrators Posted May 29, 2018 What an odd property (CurrCol) to be protected. Has anything changed in this respect in the past 5 years ? I'm coming towards the end of my UniGUI evaluation - just the Grid to test and I'm finding it missing a lot of functionality compared to thge VCL grids I'm used to. Hopefully just the learning curve, rather than missing features. Hi, What are those functions that you have found missing? If you are referring to standard VCL.TDBGrid, uniGUI already has a lot far more features compared with it. Quote
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.