?
Solved

Delete selected rows

Posted on 2005-03-23
3
Medium Priority
?
364 Views
Last Modified: 2013-12-26
Hi,

I want to delete selected rows from my dw.
I had written the below code for this.

Long ll_Rows,ll_i

ll_Rows = dw_1.RowCount()
FOR ll_i = 1 To ll_Rows
      IF dw_1.IsSelected(ll_i) THEN
          dw_1.DeleteRow(ll_i)
      END IF
NEXT

It is not deleting all the selected rows. I think, row numbers are changing after first delete.

What is the another way?

Thanks
Srinib
0
Comment
Question by:srinib
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
3 Comments
 
LVL 18

Expert Comment

by:diasroshan
ID: 13610108
hi,

try,

Long ll_Rows,ll_i

//ll_Rows = dw_1.RowCount()
FOR ll_i = 1 to dw_1.RowCount()
     IF dw_1.IsSelected(ll_i) THEN
         dw_1.DeleteRow(ll_i)
     END IF
NEXT


Cheers,
Rosh
0
 
LVL 18

Accepted Solution

by:
diasroshan earned 120 total points
ID: 13610144
or try,

Long ll_Rows,ll_i

//ll_Rows = dw_1.RowCount()
FOR ll_i = dw_1.RowCount() to 1 Step -1
     IF dw_1.IsSelected(ll_i) THEN
         dw_1.DeleteRow(ll_i)
     END IF
NEXT


Cheers,
Rosh
0
 
LVL 8

Expert Comment

by:gajender_99
ID: 13610265
Long ll_Rows,ll_i

ll_Rows = dw_1.RowCount()
FOR ll_i = 1 to ll_rows
     IF dw_1.IsSelected(ll_i) THEN
         dw_1.DeleteRow(ll_i)
    ll_i=1
    ll_Rows = dw_1.RowCount()
     END IF
NEXT




goodluck
gajender
0

Featured Post

New benefit for Premium Members - Upgrade now!

Ready to get started with anonymous questions today? It's easy! Learn more.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Programmer's Notepad is, one of the best free text editing tools available, simply because the developers appear to have second-guessed every weird problem or issue a programmer is likely to run into. One of these problems is selecting and deleti…
Here is a helpful source code for C++ Builder programmers that allows you to manage and manipulate HTML content from C++ code, while also handling HTML events like onclick, onmouseover, ... Some objects defined and used in this source include: …
The viewer will learn how to use NetBeans IDE 8.0 for Windows to connect to a MySQL database. Open Services Panel: Create a new connection using New Connection Wizard: Create a test database called eetutorial: Create a new test tabel called ee…
The viewer will learn how to use and create keystrokes in Netbeans IDE 8.0 for Windows.
Suggested Courses

777 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question