TECHNOLOGIES
FORUMS
JOBS
BOOKS
EVENTS
INTERVIEWS
Live
MORE
LEARN
Training
CAREER
MEMBERS
VIDEOS
NEWS
BLOGS
Sign Up
Login
No unread comment.
View All Comments
No unread message.
View All Messages
No unread notification.
View All Notifications
Answers
Post
An Article
A Blog
A News
A Video
An EBook
An Interview Question
Ask Question
Forums
Monthly Leaders
Forum guidelines
Sathya Narayan
NA
155
65.5k
Binding Values From ListView To Textbox and Combobox
Jun 25 2014 3:22 AM
Hi,
I am Loading the values from listview to textbox and combobox,it has just loading for textbox and which has not been loading to combobox.This is what the code, i am using to implement.
Filling To List View
Public Sub FillList()
sSql = "SELECT pname as ' Product',rate as 'Rate',ProductGroup as 'Product Group',Vatt as 'Vat',Unit as 'Unit',slno from Product_View where stu='A'"
With ListView1
.Clear()
.View = View.Details
.FullRowSelect = True
.GridLines = True
.Columns.Add("Product Name", 150)
.Columns.Add("Rate", 50)
.Columns.Add("Product Group", 150)
.Columns.Add("Vat", 50)
.Columns.Add("Unit", 50)
.Columns.Add("SLNO", 60)
FillListView(ListView1, GetData(sSql))
End With
End Sub
Fetching The Values To ListView to Textbox and Combobox
Private Sub ListView1_SelectedIndexChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles ListView1.SelectedIndexChanged
If ListView1.SelectedItems.Count > 0 Then
Product.txtproductname.Text = ListView1.SelectedItems(0).SubItems(0).Text
Product.txtrate.Text = ListView1.SelectedItems(0).SubItems(1).Text
Product.cboproductgroup.Text = ListView1.SelectedItems(0).SubItems(2).Text
Product.cbovat.Text = ListView1.SelectedItems(0).SubItems(3).Text
Product.cbounits.Text = ListView1.SelectedItems(0).SubItems(4).Text
Product.Label12.Text = ListView1.SelectedItems(0).SubItems(5).Text
Product.cmd_save.Text = "Update"
Product.DataGridView1.Visible = False
Product.GroupBox3.Visible = False
Product.Height = 245
End If
End Sub
With Regards,
Sathya
Reply
Answers (
2
)
progressbar in windows application
how to get selected value in MS Excel drop down list to c#