Help with Microsoft Flexgrid


DevX Home    Today's Headlines   Articles Archive   Tip Bank   Forums   

Results 1 to 5 of 5

Thread: Help with Microsoft Flexgrid

  1. #1
    Join Date
    Apr 2009
    Posts
    11

    Exclamation Help with Microsoft Flexgrid

    Hi

    Just wondering if anyone can help me.

    I've written a basic piece of code that searches through and excel sheet and brings it into a flexgrid.

    If it finds the text that has been searched for it puts it into BOLD text. What I am trying to do is if it does not find anything then it removes it.

    This is what I have got so far...
    Code:
    Dim rownum As Long
    Dim rowtoremove As Long
    Dim num As Long
    
    If loggerflag = True Then
       Path = frmSoftRequest.cboLogger.Text
    End If
    
    frmSoftRequest.MSFlexGrid1.FillStyle = flexFillSingle
    
    For i = 0 To frmSoftRequest.MSFlexGrid1.Cols - 1
        For j = 1 To frmSoftRequest.MSFlexGrid1.Rows - 1
            If InStr(frmSoftRequest.MSFlexGrid1.TextMatrix(j, i), Path) Then
                frmSoftRequest.MSFlexGrid1.col = i
                frmSoftRequest.MSFlexGrid1.row = j
                frmSoftRequest.MSFlexGrid1.CellFontBold = True
            ElseIf InStr(frmSoftRequest.MSFlexGrid1.TextMatrix(j, i), Path) = 0 And _
                frmSoftRequest.MSFlexGrid1.Rows <> 1 And frmSoftRequest.MSFlexGrid1.Cols <> 1 Then
                frmSoftRequest.MSFlexGrid1.RemoveItem (frmSoftRequest.MSFlexGrid1.row)
            End If
        Next j
    Next i
    Last edited by Hack; 04-08-2009 at 11:25 AM. Reason: Added Code Tags And Indenting

  2. #2
    Join Date
    Apr 2007
    Location
    Sterling Heights, Michigan
    Posts
    8,666
    Quote Originally Posted by Muppet2009 View Post
    If it finds the text that has been searched for it puts it into BOLD text. What I am trying to do is if it does not find anything then it removes it.
    I'm scratchin' my head a little bit here.

    If it doesn't find anything, it removes it....how can it remove something it didn't find?
    I don't answer coding questions via PM or Email. Please post a thread in the appropriate forum section.
    Please use [Code]your code goes in here[/Code] tags when posting code.
    Before posting your question, did you look here?
    Got a question on Linux? Visit our Linux sister site.
    Modifications Required For VB6 Apps To Work On Vista

  3. #3
    Join Date
    Apr 2009
    Posts
    11
    What it does it pulls everything into the flexgrid, then I want it to take out the rows that do not contain what i need.

  4. #4
    Join Date
    Apr 2007
    Location
    Sterling Heights, Michigan
    Posts
    8,666
    In that case, why not just
    Code:
    ElseIf InStr(frmSoftRequest.MSFlexGrid1.TextMatrix(j, i), Path) = 0  Then
         frmSoftRequest.MSFlexGrid1.RemoveItem (frmSoftRequest.MSFlexGrid1.row)
    I don't answer coding questions via PM or Email. Please post a thread in the appropriate forum section.
    Please use [Code]your code goes in here[/Code] tags when posting code.
    Before posting your question, did you look here?
    Got a question on Linux? Visit our Linux sister site.
    Modifications Required For VB6 Apps To Work On Vista

  5. #5
    Join Date
    Apr 2009
    Posts
    11
    Have already tried that and comes up with "Cannot do a Removeitem on a Fixed Row.

    As it is counting the headers as a row, and the headers are fixed.

Similar Threads

  1. ANN: Release of DeKlarit 2.0 for Microsoft Visual Studio .NET
    By Maria Jose Serres in forum dotnet.announcements
    Replies: 0
    Last Post: 02-19-2003, 03:54 PM
  2. Microsoft gains Visual Studio .NET momentum
    By Patrick Troughton in forum .NET
    Replies: 1
    Last Post: 02-12-2003, 10:31 AM
  3. Microsoft Arrogance XP
    By Patrick Troughton in forum .NET
    Replies: 1
    Last Post: 10-03-2001, 02:02 AM
  4. Row Selection in Microsoft Flexgrid Control
    By Srinidhi in forum VB Classic
    Replies: 1
    Last Post: 04-24-2001, 07:01 AM
  5. Russell Jones
    By Bill Seddon in forum .NET
    Replies: 85
    Last Post: 02-01-2001, 03:49 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
HTML5 Development Center
 
 
FAQ
Latest Articles
Java
.NET
XML
Database
Enterprise
Questions? Contact us.
C++
Web Development
Wireless
Latest Tips
Open Source


   Development Centers

   -- Android Development Center
   -- Cloud Development Project Center
   -- HTML5 Development Center
   -- Windows Mobile Development Center