Link to home
Start Free TrialLog in
Avatar of Mateen
Mateen

asked on

How to remove a highlighted row.

pb version 7

data window name dw_1
shared by
dataobject in datawindow control dw_base_list. Its dataobject has been set at runtime.

In dw_base_list when I select a row, the row is higlighted.

When I insert a row, a new row is created in dw_base_list and it scrolls to bottom of the dw_base_list, but the problem is the old row is still higlighted.

I have tried selectrow(0,false) before insert but it does not work.

I insert row by this command
dw_1.insertrow(0)

dw_base_list is created in grid datawindow and the dataobject set to it does not allow update.
Avatar of gajender_99
gajender_99

HI TRY THIS

LONG VLL_ROW

VLL_ROW=DW_1.INSERTROW(0)
dw_base_list.selectrow(0,false)
dw_base_list.selectrow(vll_row, true)

hope this will work

Gajender
Avatar of Mateen

ASKER

Yes It worked.

Thanks

One more favour.

I want to stop multiselection ( by pressing control key etc) in dw_base_list.

Also, If click very quickly rows in dw_base_list, then , at times, the situation is that One row is selected
and the previous selected row is shaded.

Any idea?

hi mateen,

try this on the clicked event of dw_list

this.selectrow(0,false)
this.SetRow(row)
this.selectrow(row,true)

is it with black shadow for a single column? Let me know.

Gajender


Avatar of Mateen

ASKER

this.selectrow(0,false)
this.SetRow(row)
this.selectrow(row,true)

This does not problem.

<<is it with black shadow for a single column?>>
Yes

1) If I drag the mouse , multiple rows are selected. I DO NOT WANT THIS.

2) If I click the Title, all rows are selected. I DO NOT WANT THIS.

3) I ONLY WANT , ONE ROW SELECTION AT ONE TIME.

Ans for
 If I click the Title, all rows are selected. I DO NOT WANT THIS.

on dw clicked enent you can use this.

if row>0 then
      this.selectrow(0,false)
      this.SetRow(row)
      this.selectrow(row,true)
End if
ASKER CERTIFIED SOLUTION
Avatar of gajender_99
gajender_99

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of Mateen

ASKER

Hi gagender

<<open the datawindow and go to the properties and untick the mouse selection.>>

Yes!!!

Untick the mouse selection and column moving.
Then we do not need any code in the clicked event except this
dw_1.scrolltorow(row)


Many thanks and very best regards.