473,387 Members | 1,603 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,387 software developers and data experts.

Delete Null Rows From a Grid

While filing in a grid,total i am getting 19 rows,from which all 14 rows are
filing(datas exist),then 15,16,17,18 rows are blank(means null),but then 19th rows are filing.but i don't want these 15,16,17,18 rows.but i need 19 rows

so how to delete those blank rows,can any one tell how to merge those
15,16,17,18,19 rows in one rows,but it has to show 19 row data.


Regards,
Ibrahim
Nov 11 '08 #1
2 1148
VijaySofist
107 100+
Hi!

Can you please Tell me what grid you are using in your program.

If you mean for a MsFlexGrid, Here is the code

Expand|Select|Wrap|Line Numbers
  1. Private Sub Command1_Click()
  2.     DeleteEmptyRows
  3. End Sub
  4. Sub DeleteEmptyRows()
  5.     Dim i As Long
  6.     i = 0
  7.     Dim RowDelete As Boolean
  8.     Do While i <= (MSFlexGrid1.Rows - 1)
  9.         RowDelete = DeleteRow(i)
  10.         If RowDelete = True Then
  11.             MSFlexGrid1.RemoveItem (i)
  12.             i = 0
  13.         End If
  14.         i = i + 1
  15.     Loop
  16. End Sub
  17.  
  18. Function DeleteRow(rowno As Long) As Boolean
  19.     Dim EmptyRow As Boolean
  20.     Dim i As Long
  21.     i = 0
  22.     EmptyRow = False
  23.     Do While i <= (MSFlexGrid1.Cols - 1)
  24.  
  25.         If ((i = (MSFlexGrid1.Cols - 1)) And (Trim(MSFlexGrid1.TextMatrix(rowno, i)) = "")) Then
  26.             EmptyRow = True
  27.         Else
  28.             If Trim(MSFlexGrid1.TextMatrix(rowno, i)) = "" Then
  29.                 EmptyRow = True
  30.             Else
  31.                 EmptyRow = False
  32.                 Exit Do
  33.             End If
  34.         End If
  35.         i = i + 1
  36.     Loop
  37.     DeleteRow = EmptyRow
  38. End Function
  39.  

Thanks and Regards
Vijay. R
Nov 12 '08 #2
Thanks Vijay,

I need this one only.

Regards,
Ibrahim
Nov 12 '08 #3

Sign in to post your reply or Sign up for a free account.

Similar topics

4
by: Chris | last post by:
Hi, sorry to post OT but i cant find the MySQL newsgroup, however i am hoping to pick up on some expert advice from php/mysql gurus here. I'm having some trouble performing a delete across two...
0
by: Gordon | last post by:
I have 2 tables t and t1. In this case, t1 is a copy of t. I want to delete rows from t1 based on criteria on the t table and a relationship between t ad t1 (in this case the id column). In the...
2
by: michael | last post by:
Gotta post because this is driving me nuts. Trying to DELETE orphans. I can successfully: SELECT GroupID FROM Groups LEFT JOIN Users ON UsersID = UserID WHERE UsersID IS NULL; but when I...
1
by: Andrew DeFaria | last post by:
I created the following .sql file to demonstrate a problem I'm having. According to the manual: If |ON DELETE CASCADE| is specified, and a row in the parent table is deleted, then InnoDB...
2
by: Bob Ganger | last post by:
Hello, I am working on a project using SQL Server 2000 with a database containing about 10 related tables with a lot of columns containing text. The total current size of the database is about...
4
by: pedicini | last post by:
I work with many dynamically allocated variables in my program including double **, int *, char *. For ex: double **d; d = new (double *) ; for(int i = 0; i < 10; i++) { d = new double; }
0
by: Clay Luther | last post by:
Again, we have an odd performance problem with PGSQL, 7.4b2. Here is the query: delete from numplan where pkid in (select numplan.pkid from numplan left outer join pilothuntgroup on...
3
by: vcornjamb | last post by:
Hello, I am developing a web form that contains some buttons and a data grid which has as its last column link buttons that will delete the data associated with that row. Everything works fine,...
6
by: polocar | last post by:
Hi, I'm writing a program in Visual C# 2005 Professional Edition. This program connects to a SQL Server 2005 database called "Generations" (in which there is only one table, called...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.