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
So for this program im trying to print out the max height the projectile reaches and when i run the str on the object it dosent change the value to ...
Is C similar to C# (C-sharp); or are they completely different ? I was wondering if I should begin learning C# and the transition to C will be a tad ...
Write a program that displays all numbers divisible by 3 and 4 within a range entered by user. Display five numbers per line. Numbers are separated by exactly two spaces. ...