problem with the InplaceEdit

Hi,

I am having a problem with the InplaceEdit, It will not go away? If I edit a cell and close the form without clicking a different cell the next time I load the form and refresh the grid its still there with the old value?

I have tried using grid.HideInplaceEdit but it does nothing. I have also tried grid.col := 1 but it still remains until I use the mouse to click on a different cell.

How can I get the inplase editor to stop in code?

Thanks.

I cannot see a problem with HideInplaceEdit here.
This does close the inplace editor.
Do you use the latest version? Did you test this on a separate project?
If a problem persists, please provide some sample source app with which we can reproduce the problem.

Hi,

Thanks for the fast reply. I am on the new version I use the TMS Subscription Manager to update the components.

It may be something in my code but I did not notice it before the last update. Here is what I do:

In the grid ClickCell procedure I show a popup which is just a form that just has 10 buttons on it as the customer wanted a quick way to set the values between 1 and 10 but also wanted to keep the normal SpinEdit. When they click a button on the form it runs a callback to set the cell value.  This works ok most of the time but it seems to leave the in place editor open when they close the form.

I just need a way of forcing the edit to stop if that makes sense?

Thanks.

I have not sufficient information to reproduce this.

For example, do you show the form modal or not? Grid property settings ?
If a problem persists, please contact us by email and include some sample source project with which we can reproduce the problem.

Hi,
Sorry for taking so long to reply. It seems to be the Grid.MouseActions.DirectEdit setting as when I turned this off the in place editor works as expected. With this on the in place editor behaves very strange. I tried it without the popup and it still does not like the Grid.MouseActions.DirectEdit. I may have misunderstood the doc when I read about the Grid.MouseActions.DirectEdit setting.

Thanks.

Grid.MouseActions.DirectEdit = true means that when there is a single click on the cell, irrespective of the selection state of the cell, that it will start inplace editing. When 
Grid.MouseActions.DirectEdit = false, inplace editing will only start after a click on a selected cell.

I have same problem with TDBAdvGrid version 2.3.3.3, version before worked without problem now HideInplaceEdit() doesn't  work (also with Grid.MouseActions.DirectEdit set to false). BCB 6 version.

Please provide more details how exactly we can reproduce this problem here, preferably with some sample source app with which we can immediately see all code / property settings involved.

I have one TDBAdvGrid connected to  TIBQuery and a TDBAdvNavigator, when I insert a new row and set the 'TAR' column value by code I have no problem, but if I try to change the value of this column (selecting the value from the drop down list) in the grid and post the value with Post button in navigator the system throw an exception saying the column value is null (value not accepted for this field), if I change the value and before to post I select an other column the exception doesn't throw. I have put the HideInplaceEdit() in  BeforeAction event in Navigator.
The TDBAdvGrid has this declaration:
object DBAdvGrid3: TDBAdvGrid
    Left = 120
    Top = 338
    Width = 286
    Height = 101
    Cursor = crDefault
    ColCount = 4
    RowCount = 2
    FixedRows = 1
    Font.Charset = DEFAULT_CHARSET
    Font.Color = clWindowText
    Font.Height = -11
    Font.Name = 'Tahoma'
    Font.Style = []
    Options = [goFixedVertLine, goFixedHorzLine, goVertLine, goHorzLine, goRangeSelect, goDrawFocusSelected, goRowMoving, goColMoving, goEditing]
    ParentFont = False
    ScrollBars = ssBoth
    TabOrder = 19
    OnEnter = DBAdvGrid3Enter
    HoverRowCells = [hcNormal, hcSelected]
    ActiveCellFont.Charset = DEFAULT_CHARSET
    ActiveCellFont.Color = clWindowText
    ActiveCellFont.Height = -11
    ActiveCellFont.Name = 'Tahoma'
    ActiveCellFont.Style = [fsBold]
    ActiveCellColor = 9758459
    ActiveCellColorTo = 1414638
    AutoThemeAdapt = True
    CellNode.TreeColor = clSilver
    ColumnHeaders.Strings = (
      ''
      'Tar'
      'Dal'
      'Tratt.'
      '')
    ControlLook.FixedGradientFrom = 16572875
    ControlLook.FixedGradientTo = 14722429
    ControlLook.FixedGradientHoverFrom = clGray
    ControlLook.FixedGradientHoverTo = clWhite
    ControlLook.FixedGradientDownFrom = clGray
    ControlLook.FixedGradientDownTo = clSilver
    ControlLook.DropDownHeader.Font.Charset = DEFAULT_CHARSET
    ControlLook.DropDownHeader.Font.Color = clWindowText
    ControlLook.DropDownHeader.Font.Height = -11
    ControlLook.DropDownHeader.Font.Name = 'Tahoma'
    ControlLook.DropDownHeader.Font.Style = []
    ControlLook.DropDownHeader.Visible = True
    ControlLook.DropDownHeader.Buttons = <>
    ControlLook.DropDownFooter.Font.Charset = DEFAULT_CHARSET
    ControlLook.DropDownFooter.Font.Color = clWindowText
    ControlLook.DropDownFooter.Font.Height = -11
    ControlLook.DropDownFooter.Font.Name = 'MS Sans Serif'
    ControlLook.DropDownFooter.Font.Style = []
    ControlLook.DropDownFooter.Visible = True
    ControlLook.DropDownFooter.Buttons = <>
    EnhRowColMove = False
    Filter = <>
    FilterDropDown.Font.Charset = DEFAULT_CHARSET
    FilterDropDown.Font.Color = clWindowText
    FilterDropDown.Font.Height = -11
    FilterDropDown.Font.Name = 'MS Sans Serif'
    FilterDropDown.Font.Style = []
    FilterDropDownClear = '(All)'
    FixedColWidth = 8
    FixedRowHeight = 22
    FixedFont.Charset = DEFAULT_CHARSET
    FixedFont.Color = clWindowText
    FixedFont.Height = -11
    FixedFont.Name = 'Tahoma'
    FixedFont.Style = [fsBold]
    FloatFormat = '%.2f'
    Navigation.AllowInsertRow = True
    Navigation.AllowDeleteRow = True
    Navigation.AdvanceAutoEdit = False
    Navigation.InsertPosition = pInsertAfter
    PrintSettings.DateFormat = 'dd/mm/yyyy'
    PrintSettings.Font.Charset = DEFAULT_CHARSET
    PrintSettings.Font.Color = clWindowText
    PrintSettings.Font.Height = -11
    PrintSettings.Font.Name = 'MS Sans Serif'
    PrintSettings.Font.Style = []
    PrintSettings.FixedFont.Charset = DEFAULT_CHARSET
    PrintSettings.FixedFont.Color = clWindowText
    PrintSettings.FixedFont.Height = -11
    PrintSettings.FixedFont.Name = 'MS Sans Serif'
    PrintSettings.FixedFont.Style = []
    PrintSettings.HeaderFont.Charset = DEFAULT_CHARSET
    PrintSettings.HeaderFont.Color = clWindowText
    PrintSettings.HeaderFont.Height = -11
    PrintSettings.HeaderFont.Name = 'MS Sans Serif'
    PrintSettings.HeaderFont.Style = []
    PrintSettings.FooterFont.Charset = DEFAULT_CHARSET
    PrintSettings.FooterFont.Color = clWindowText
    PrintSettings.FooterFont.Height = -11
    PrintSettings.FooterFont.Name = 'MS Sans Serif'
    PrintSettings.FooterFont.Style = []
    PrintSettings.PageNumSep = '/'
    SearchFooter.Color = 16572875
    SearchFooter.ColorTo = 14722429
    SearchFooter.FindNextCaption = 'Find next'
    SearchFooter.FindPrevCaption = 'Find previous'
    SearchFooter.Font.Charset = DEFAULT_CHARSET
    SearchFooter.Font.Color = clWindowText
    SearchFooter.Font.Height = -11
    SearchFooter.Font.Name = 'MS Sans Serif'
    SearchFooter.Font.Style = []
    SearchFooter.HighLightCaption = 'Highlight'
    SearchFooter.HintClose = 'Close'
    SearchFooter.HintFindNext = 'Find next occurence'
    SearchFooter.HintFindPrev = 'Find previous occurence'
    SearchFooter.HintHighlight = 'Highlight occurences'
    SearchFooter.MatchCaseCaption = 'Match case'
    Version = '2.3.3.4'
    AutoCreateColumns = True
    AutoRemoveColumns = True
    Columns = <
      item
        Borders = []
        BorderPen.Color = clSilver
        CheckFalse = 'N'
        CheckTrue = 'Y'
        Color = clWindow
        Font.Charset = DEFAULT_CHARSET
        Font.Color = clWindowText
        Font.Height = -11
        Font.Name = 'Tahoma'
        Font.Style = []
        HeaderFont.Charset = DEFAULT_CHARSET
        HeaderFont.Color = clWindowText
        HeaderFont.Height = -11
        HeaderFont.Name = 'Tahoma'
        HeaderFont.Style = []
        PrintBorders = [cbTop, cbLeft, cbRight, cbBottom]
        PrintFont.Charset = DEFAULT_CHARSET
        PrintFont.Color = clWindowText
        PrintFont.Height = -11
        PrintFont.Name = 'Tahoma'
        PrintFont.Style = []
        Width = 8
      end
      item
        Alignment = taRightJustify
        Borders = []
        BorderPen.Color = clSilver
        CheckFalse = 'N'
        CheckTrue = 'Y'
        Color = clWindow
        FieldName = 'TAR'
        Font.Charset = DEFAULT_CHARSET
        Font.Color = clWindowText
        Font.Height = -11
        Font.Name = 'Tahoma'
        Font.Style = []
        Header = 'Tariffa'
        HeaderFont.Charset = DEFAULT_CHARSET
        HeaderFont.Color = clWindowText
        HeaderFont.Height = -11
        HeaderFont.Name = 'Tahoma'
        HeaderFont.Style = []
        PrintBorders = [cbTop, cbLeft, cbRight, cbBottom]
        PrintFont.Charset = DEFAULT_CHARSET
        PrintFont.Color = clWindowText
        PrintFont.Height = -11
        PrintFont.Name = 'Tahoma'
        PrintFont.Style = []
        Width = 87
      end
      item
        Borders = []
        BorderPen.Color = clSilver
        CheckFalse = 'N'
        CheckTrue = 'Y'
        Color = clWindow
        Editor = edDateEdit
        FieldName = 'DAL'
        Font.Charset = DEFAULT_CHARSET
        Font.Color = clWindowText
        Font.Height = -11
        Font.Name = 'Tahoma'
        Font.Style = []
        Header = 'Dal'
        HeaderFont.Charset = DEFAULT_CHARSET
        HeaderFont.Color = clWindowText
        HeaderFont.Height = -11
        HeaderFont.Name = 'Tahoma'
        HeaderFont.Style = []
        PrintBorders = [cbTop, cbLeft, cbRight, cbBottom]
        PrintFont.Charset = DEFAULT_CHARSET
        PrintFont.Color = clWindowText
        PrintFont.Height = -11
        PrintFont.Name = 'Tahoma'
        PrintFont.Style = []
        Width = 107
      end
      item
        Borders = []
        BorderPen.Color = clSilver
        CheckFalse = 'N'
        CheckTrue = 'Y'
        Color = clWindow
        ComboItems.Strings = (
          'PC'
          'PN'
          'MP'
          'BB')
        Editor = edComboList
        FieldName = 'TRATT'
        Font.Charset = DEFAULT_CHARSET
        Font.Color = clWindowText
        Font.Height = -11
        Font.Name = 'Tahoma'
        Font.Style = []
        Header = 'Tratt.'
        HeaderFont.Charset = DEFAULT_CHARSET
        HeaderFont.Color = clWindowText
        HeaderFont.Height = -11
        HeaderFont.Name = 'Tahoma'
        HeaderFont.Style = []
        PrintBorders = [cbTop, cbLeft, cbRight, cbBottom]
        PrintFont.Charset = DEFAULT_CHARSET
        PrintFont.Color = clWindowText
        PrintFont.Height = -11
        PrintFont.Name = 'Tahoma'
        PrintFont.Style = []
        Width = 41
      end>
    DataSource = ds_prentar
    DataSetType = dtNonSequenced
    EditPostMode = epRow
    
    RefreshOnInsert = True
    ShowUnicode = False
    ColWidths = (
      8
      87
      107
      41)
    RowHeights = (
      22
      22)
  end

Sorry I say the Tar column in the post but the column is the fourth: 'Tratt'

Did you compare/check our sample applications like ADOEditing / ADOLookup /... where all this is working?
What is the field type of the column where you have a problem?
Do you implement OnCellValidate ? This event should be triggered with the edited value passed as value parameter.

Is your DB field not readonly / update-able?

I installed old TMSPACK version (6.2.3.0) and the problem is not present, so I think there is something changed between this version and most recent version wich raise the problem.

Please provide some sample source app with which we can reproduce the problem.
Did you check the ADOEdting / ADOLookup samples? Are these working as expected on your system?

I have same error with ADOediting. 

This is what I did:
  1. Open ADOEditing sample with Delphi XE
  2. Change column type editor in edComboList of field "TYPE" and put some values in ComboItems
  3. Run the sample and modify the value in column  TYPE
  4. If I modify the value selecting from the combo list and I post the update with Post button on navigator, the field become null
  5. If I modify the value selecting from the combo list and then I go on next column the value is right.
  6. If I put the HideInplaceEdit on before action event of navigator button in your sample give the error "Data set not in edit mode" 

Problem solved. With newer version I must not change the column index (Col property) by code before HideInplaceEdit, maybe something has changed between older and newer release (6.5).