Results 1 to 9 of 9

Thread: Delete Row in MSFLexGrid...

  1. #1

    Thread Starter
    New Member
    Join Date
    Jan 2009
    Posts
    2

    Delete Row in MSFLexGrid...

    Please, any kind of you can help me How to Delete Row in MSFLexGrid..

    so, when i click the button 'RENAME' and 'DELETE' it Could be processed.
    So, How to do that..??
    Please some kind of you could help me

    this, i've got pic for my app..

    Last edited by melvy; Jan 7th, 2009 at 10:40 PM.

  2. #2
    I'm about to be a PowerPoster! Hack's Avatar
    Join Date
    Aug 2001
    Location
    Searching for mendhak
    Posts
    58,333

    Re: Delete Row in MSFLexGrid...

    Welcome to the forums.

    I have no idea what you mean by RENAME? Rename what?

    As far as deleting is concerned, remove the record from your datasource (typically a database table) then clear and reload the grid.

  3. #3
    Ex-Super Mod RobDog888's Avatar
    Join Date
    Apr 2001
    Location
    LA, Calif. Raiders #1 AKA:Gangsta Yoda™
    Posts
    60,709

    Re: Delete Row in MSFLexGrid...

    A "RENAME" button click should issue an UPDATE statement to your underlying record in your table. A "DELETE" button would execute a DELETE statement to the table. Then refresh the grid by rebinding your datasource.
    VB/Office Guru™ (AKA: Gangsta Yoda®)
    I dont answer coding questions via PM. Please post a thread in the appropriate forum.

    Microsoft MVP 2006-2011
    Office Development FAQ (C#, VB.NET, VB 6, VBA)
    Senior Jedi Software Engineer MCP (VB 6 & .NET), BSEE, CET
    If a post has helped you then Please Rate it!
    Reps & Rating PostsVS.NET on Vista Multiple .NET Framework Versions Office Primary Interop AssembliesVB/Office Guru™ Word SpellChecker™.NETVB/Office Guru™ Word SpellChecker™ VB6VB.NET Attributes Ex.Outlook Global Address ListAPI Viewer utility.NET API Viewer Utility
    System: Intel i7 6850K, Geforce GTX1060, Samsung M.2 1 TB & SATA 500 GB, 32 GBs DDR4 3300 Quad Channel RAM, 2 Viewsonic 24" LCDs, Windows 10, Office 2016, VS 2019, VB6 SP6

  4. #4
    PowerPoster
    Join Date
    Oct 2002
    Location
    British Columbia
    Posts
    9,758

    Re: Delete Row in MSFLexGrid...

    To delete a row in the MSFlexGrid call the RemoveItem method passing it the row number you wish to delete.

    MSFlexGrid1.RemoveItem 4

  5. #5
    Lively Member
    Join Date
    Jan 2008
    Posts
    114

    Re: Delete Row in MSFLexGrid...

    Code I kinda got to work to rename stuff. Label1.caption would equal the selected row number. Load the data into text box then save the text box as the same row.

    Code:
    Private Sub Command3_Click()
    
    If Text1.Text = "" Or Text2.Text = "" Or Text3.Text = "" Then
        MsgBox "Please Fill In The Required Text Box's" 'Error Report
            Else
                    
    'Save to Flexgrid
    Msflexgrid1.TextMatrix(Label1.Caption, 0) = Text1.Text
    
    Msflexgrid1.TextMatrix(Label1.Caption, 1) = Text2.Text
    
    Msflexgrid1.TextMatrix(Label1.Caption, 2) = Text3.Text
    
    Msflexgrid1.TextMatrix(Label1.Caption, 4) = Text4.Text
    
    Label1.Caption = ""
    
    End If
    
    End Sub
    Code:
    Private Sub Command2_Click()
    Dim i
    For i = Msflexgrid1.Row To Msflexgrid1.RowSel
        
    Text1.Text = Msflexgrid1.TextMatrix(i, 0)
    
    Text2.Text = Msflexgrid1.TextMatrix(i, 1)
    
    Text3.Text = Msflexgrid1.TextMatrix(i, 2)
    
    Label1.Caption = i
    Next i
    
    End Sub
    "What is a hackers worst nightmare you may ask? Vista! Not that its hard to bypass its just that it gives you stupid annoying errors!"


  6. #6

    Thread Starter
    New Member
    Join Date
    Jan 2009
    Posts
    2

    Re: Delete Row in MSFLexGrid...

    OMG,, your reply was so fast..
    hahhahaha
    Ok,, Now you can take a look at my pic at the top post..

    ehm, So sorry if my english wasn't good..
    i just try to be better..

  7. #7

    Thread Starter
    New Member
    Join Date
    Jan 2009
    Posts
    2

    Re: Delete Row in MSFLexGrid...

    Quote Originally Posted by Hack
    Welcome to the forums.

    I have no idea what you mean by RENAME? Rename what?

    As far as deleting is concerned, remove the record from your datasource (typically a database table) then clear and reload the grid.
    I just add a pic to my post..
    Take a look over that dude...
    thanx
    ^^

  8. #8
    Software Carpenter dee-u's Avatar
    Join Date
    Feb 2005
    Location
    Pinas
    Posts
    11,127

    Re: Delete Row in MSFLexGrid...

    Do you mean to say you don't know how to execute the commands for those menus? They have Click events that you could use if that is what you are asking.
    Regards,


    As a gesture of gratitude please consider rating helpful posts. c",)

    Some stuffs: Mouse Hotkey | Compress file using SQL Server! | WPF - Rounded Combobox | WPF - Notify Icon and Balloon | NetVerser - a WPF chatting system

  9. #9
    New Member
    Join Date
    Jan 2009
    Posts
    1

    Re: Delete Row in MSFLexGrid...

    To Delete a row from a MsFlexgrid is fairly simple; thats if i understood your question.

    Paste this code sample.
    Private Sub MSFlexGrid1_DblClick()
    'This helps to remove the selected row
    MSFlexGrid1.RemoveItem MSFlexGrid1.RowSel
    End Sub

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width