petr.nehez Posted August 24, 2011 Posted August 24, 2011 Hi, I am playing with TUniDBGrid and I'd like to know if it is possible to find out selected row and column. Thanks for any info. Quote
patmap Posted August 24, 2011 Posted August 24, 2011 hi, In AjaxEvent of UniDBGrid use this code: procedure TFDevices.UniDBGrid1AjaxEvent(Sender: TComponent; EventName: string; Params: TStrings); begin if SameText(EventName, 'cellselect') then Caption := 'RowID = ' + Params.Values['rowindex'] + ' and ColName = ' + UniDBGrid1.Columns[strToInt(Params.Values['colindex'])].FieldName ; end; Best Regards Quote
thecrgrt Posted August 24, 2011 Posted August 24, 2011 hi, In AjaxEvent of UniDBGrid use this code: procedure TFDevices.UniDBGrid1AjaxEvent(Sender: TComponent; EventName: string; Params: TStrings); begin if SameText(EventName, 'cellselect') then Caption := 'RowID = ' + Params.Values['rowindex'] + ' and ColName = ' + UniDBGrid1.Columns[strToInt(Params.Values['colindex'])].FieldName ; end; Best Regards That's a good applying. Quote
petr.nehez Posted August 25, 2011 Author Posted August 25, 2011 In AjaxEvent of UniDBGrid use this code: procedure TFDevices.UniDBGrid1AjaxEvent(Sender: TComponent; EventName: string; Params: TStrings); begin if SameText(EventName, 'cellselect') then Caption := 'RowID = ' + Params.Values['rowindex'] + ' and ColName = ' + UniDBGrid1.Columns[strToInt(Params.Values['colindex'])].FieldName ; end; This looks fine, in the meantime I've found another solution: function OnKeydown(e) { if ((e) && (e.keyCode == 113)) { var sc = formCategoriesStages.gridCategoryCodes.selModel.getSelectedCell(); if (sc) { formCategoriesStages.gridCodes.startEditing(sc[0], sc[1]); } } } Do you think that it'll be 100% functional? Quote
Administrators Farshad Mohajeri Posted August 28, 2011 Administrators Posted August 28, 2011 Hi, I am playing with TUniDBGrid and I'd like to know if it is possible to find out selected row and column. Thanks for any info. Current Row is same as DataSet current Row and you can use RecNo property where supported. Quote
jslogix Posted December 17, 2015 Posted December 17, 2015 It didn't works, why the UniDBGrid doesn't have a SelectedRow property ? Quote
Administrators Farshad Mohajeri Posted December 17, 2015 Administrators Posted December 17, 2015 It does have. Please install the latest build. 1 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.