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..
http://i43.tinypic.com/2nqv86f.jpg
Re: Delete Row in MSFLexGrid...
Welcome to the forums. :wave:
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.
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.
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
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
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..
Re: Delete Row in MSFLexGrid...
Quote:
Originally Posted by Hack
Welcome to the forums. :wave:
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
^^
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.
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