cancel
Showing results for 
Search instead for 
Did you mean: 

DATA WINDOW SETCOLUMN NOT WORKING

Former Member
0 Kudos

Hi all

I am creating a tabular data window. My purpose, is when the user press Enter Key at the last column, a new row should be inserted and the focus should come to the "employee id" column.

My code is given below.


Data window Item Changed event

Choose Case dwo.name

  Case 'amount'

        If KeyDown(KeyEnter!) Then

           TriggerEvent("clicked")

       End if

End Choose

Datawindow Clicked Event

      currow=dw_1.insertrow(0)

       dw_1.ScrollToRow(currow)

       dw_1.SetRowFocusIndicator(Hand!)

       dw_1.Object.processcode[currow]=process

       dw_1.SetColumn("empid")

      DW_1.SETFOCUS()

The problem is that the focus is not coming to the "empid" column in the new row. It goes into the "amount" column itself in the new row.

Am I forgetting to do something?

Regards

JAMOHAN

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

Hi Jamohan.

Try to change to reorder set commands by placing setcolumn after setfocus. If its still not working try to change the SetColumn command as follows:

dw_1.post SetColumn("empid")

Try it and tell us if it works well.

Andreas.

Former Member
0 Kudos

Hi Andreas

Thank you..it worked once the sets were reordered.

Regards

JAIMOHAN

Answers (0)