diff --git a/uppsrc/DropGrid/DropGrid.cpp b/uppsrc/DropGrid/DropGrid.cpp index a5ba43bf0..bc49acf6a 100644 --- a/uppsrc/DropGrid/DropGrid.cpp +++ b/uppsrc/DropGrid/DropGrid.cpp @@ -114,6 +114,8 @@ void DropGrid::Drop() { if(!IsEditable()) return; + + WhenDrop(); GridDisplay &dsp = list.GetDisplay(); if(!header) @@ -478,8 +480,13 @@ int DropGrid::GetCount() const Value DropGrid::GetData() const { - return valuekey ? value - : rowid >= 0 ? list.Get(key_col) : notnull ? NotNullError() : Null; + return valuekey + ? value + : rowid >= 0 + ? list.Get(key_col) + : notnull + ? NotNullError() + : Null; } Value DropGrid::GetValue() const @@ -998,7 +1005,7 @@ Value DropGrid::MakeValue(int r, bool columns) const Value DropGrid::Format0(const Value& q, int rowid) const { - int r = rowid >= 0 ? list.FindRow(rowid) : list.Find(q, key_col); + int r = rowid >= 0 ? list.FindRow(rowid + list.GetFixedCount()) : list.Find(q, key_col); if(r < 0) return Null; diff --git a/uppsrc/DropGrid/DropGrid.h b/uppsrc/DropGrid/DropGrid.h index 556e81a21..aa7114772 100644 --- a/uppsrc/DropGrid/DropGrid.h +++ b/uppsrc/DropGrid/DropGrid.h @@ -212,6 +212,7 @@ class DropGrid : public Convert, public GridDisplay, public Ctrl virtual Value Format(const Value& q) const; Callback WhenLeftDown; + Callback WhenDrop; GridCtrl::ItemRect& AddRow(int n = 1, int size = -1); DropGrid& Add() { AddRow(); return *this; }