i have problem here....if listview reach 2 records i disable the addmore button but when i delete 1 transaction from the list view it suppose enable the addmore button. Is there anyway i can do that. please guide me
you can always use a dataset / datatable, fill it, use a select query to return all the records, count the rows returned, if it's over a certain number then btn.visible = true ?
the code below is to disable the addmore button when it reaches 2 record. How do i make if 1 record is deleted and i have to enable the addmore button. I use the below code but it doesnt seems working. disable button working perfectly but i don't know how to enable the button back if user deleted 1 of the record in listview. Please guide me !!!
if listview1.items.count < 2 then AddMoreBtn.Enabled = true end if
If ListView1.Items.Count = 2 Then AddMoreBtn.Enabled = False frmPopup.lblErrMsg.Text = GetButtonText("only 2 record allowded") frmPopup.YesNo = False frmPopup.QorEx = False frmPopup.ShowDialog() Exit Sub End If
DataBind() after deleting the record should do the trick
i don't get you actually. Can you explain how was it base on my code.
Well the code would be
Basically refreshes the ListView with the current data, so if you've just deleted, you would databind the ListView to show the record has gone and only 1 now exists.
i'm sorry. i'm totally new to vb.net. where should i add the code on my code. If you don't mine please modify it on my codes. PLEASE !!!!
Just before your If statements, ListView1.DataBind()
Which means it will always have the latest data available to it
ok as your guidance i code like this but it gives error "databind is not member of system.window.forms.listview". PLEASE HELP ME !!!
ListView1.DataBind() If ListView1.Items.Count < 2 Then Panel1.Enabled = True End If
ohhh i forgot you're probably doing a Windows app, i'm a web developer! ¬_¬
can anyone out there can help me on this....PLEASE !!!!!
You don't have to disable your add button just use if ...else statement some thing like this
if listview1.items.count < 2 then ' your code for adding record in listview1 else messagebox.show("List view is full") endif
Best Of Luck
thank you so much
How to connect device scanner with visual basic, its analogy I made button scan in vb and typing button scan in press scanner live and walk .. how? Help ...
I have the following problem.
when i pres buttun printpreview (button 5) the the print preview fires up.
and when i close the print preview without printing and minimize the ...
Hi all! I need help understanding what my teacher expects from this project.
Here is the link to the instructions for the project: http://cs.ecu.edu/~karl/2530/spr18/Assn/Assn5/assn5.html
I wrote a little bit of ...