• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 3981
  • Last Modified:

Dev Express Quantum Grid column.EditValue

I am using dev express with one column in the cxgrid called Column1. I successfully retrieve the records and they are listed in the grid under Column1.

I want to update the value of Column1 by using the Column1.EditValue set property. If I use my mouse and select the 1st record in the grid then click on the buttom that calls Column1.EditValue := 'Test' it changes the selected row in Column1 to value 'Test'. But then the the grid jumps to the last record, instead of either staying on the 1st record or going to the next record. Can someone please help me to prevent this.

Or is there another way to update Column1's value with a value from an edit box?

Thank you in advance!
0
skynergy
Asked:
skynergy
1 Solution
 
Geert GruwezOracle dbaCommented:
if you want to change data in a devexpress grid

var r: integer;

with gridview.datacontroller do
begin
  r := FocusedRecordIndex;
  if r >= 0 then // avoid filter and insert row
  begin
    BeginUpdate;
    try
      Values[r, Column1.Index] := 'Test';
    finally
      EndUpdate;
    end;
  end;
end;
0
 
skynergyAuthor Commented:
Thank you!
0

Featured Post

Hire Technology Freelancers with Gigs

Work with freelancers specializing in everything from database administration to programming, who have proven themselves as experts in their field. Hire the best, collaborate easily, pay securely, and get projects done right.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now