In NextGrid I am using 2 columns - Text and CheckBox. After select some item in CheckBox program must find in DB some info and add it in Text cell. Now for this I am using event - OnAfterEdit. But in this case I must after select item in CheckBox click for some row or cell. This is inconvenient. Is it possible get event just after select some item in CheckBox?
CheckBox question
Started by leonidus, Jun 15 2012 09:26 AM
6 replies to this topic
#1
Posted 15 June 2012 - 09:26 AM
#2
Posted 15 June 2012 - 11:36 AM
Hi
I have tested this and OnAfterEdit is fired immediately when I click on one of the checkboxes in a CheckBoxColumn, without the need to first click on a different cell.
What options do you have on the grid and the columns? Can you post a small demo program that shows the problem?
I have tested this and OnAfterEdit is fired immediately when I click on one of the checkboxes in a CheckBoxColumn, without the need to first click on a different cell.
What options do you have on the grid and the columns? Can you post a small demo program that shows the problem?
#3
Posted 15 June 2012 - 12:51 PM
Oh sorry! Not CheckBox, I working with NxComboBoxColumn.
#4
Posted 15 June 2012 - 01:32 PM
Maybe you can use the OnCloseUp event of TNxComboBoxColumn?
The OnCloseUp event does not pass the ACol and ARow parameters like OnAfterEdit does, but you can use NextGrid1.SelectColumn and NextGrid1.SelectedRow to check which cell was edited.
The OnCloseUp event does not pass the ACol and ARow parameters like OnAfterEdit does, but you can use NextGrid1.SelectColumn and NextGrid1.SelectedRow to check which cell was edited.
#5
Posted 21 June 2012 - 01:53 PM
OnCloseUp is working but in result I also get old value:
procedure TForm23.NxComboBoxColumn1CloseUp(Sender: TObject);
begin
if NextGrid1.SelectedColumn=4 then
begin
ProxyTypeSelected:=NextGrid1.Cell[4, NextGrid1.SelectedRow].AsString;
end;
end;
If user click on 4th column (this is TNxComboBoxColumn with list of proxy types) and select some item after it start working NxComboBoxColumn1CloseUp but in ProxyTypeSelected I see old item value - not new!
procedure TForm23.NxComboBoxColumn1CloseUp(Sender: TObject);
begin
if NextGrid1.SelectedColumn=4 then
begin
ProxyTypeSelected:=NextGrid1.Cell[4, NextGrid1.SelectedRow].AsString;
end;
end;
If user click on 4th column (this is TNxComboBoxColumn with list of proxy types) and select some item after it start working NxComboBoxColumn1CloseUp but in ProxyTypeSelected I see old item value - not new!
#6
Posted 21 June 2012 - 05:07 PM
Hi leonidus
Try calling NextGrid.ApplyEditing before retrieving the value from the column.
Try calling NextGrid.ApplyEditing before retrieving the value from the column.
begin NextGrid1.ApplyEditing; NextGrid1.ShowMessage(NextGrid1.Cell[4,NextGrid1.SelectedRow].AsString); end;
#7
Posted 21 June 2012 - 11:06 PM
deonvn thanks!!!
0 user(s) are reading this topic
0 members, 0 guests, 0 anonymous users











