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
I've never been a fan of readme files. They are fine for project files where you will likely need note of building an application, or for distribution packages where you ...
I have a DGV (dgvListOfJobs), populated from an SQL database to show the user a list of 'jobs' (i.e. rows). I also show 7 other DGV's (dgvMonday, dgvTuesday, etc) ...
I was wondering if it was possible to create a software like visual studio (in addition simple, obviously). We could program in vb.net, c ++, etc.