I have a dataset that is bound to a datagridview. Not all of the columns in the dataset show in the datagridview (namely the ID value of some of the columns). When the user double clicks on a datagridview row the program shows the information for the selected item.
When the datagridview is sorted by clicking on a column header the dataset isn't sorted and sometimes the wrong ID is used and thus the wrong information is shown. How do I automatically have the dataset sort when the datagridview is sorted?
Here's some of my code for setting up the datagridview:
Dim row As Data.DataRow
' Initialize a new instance of the data access base class
objData = New DALBase
' Get all customers in a DataReader object
objData.SQL = "usp_SelectGroupProperties"
objData.DataReader = objData.Command.ExecuteReader
' See if there is any data before continuing
If objData.DataReader.HasRows Then
' Process all rows
' Add a new row to the dataset
row = objDataTable.NewRow
row("id") = objData.DataReader.Item("propertyID")
row("contactID") = objData.DataReader.Item("contactID")
row("member") = objData.DataReader.Item("contactName")
row("property") = objData.DataReader.Item("propertyName")
row("town") = objData.DataReader.Item("town")
row("state") = objData.DataReader.Item("state")
row("country") = objData.DataReader.Item("country")
row("acres") = objData.DataReader.Item("acres")
' Make it so the datagrid doesn't automatically create the columns from the dataset table
dgdMemberGroupProperty.AutoGenerateColumns = False
' Assign the datasource for the data grid
dgdMemberGroupProperty.DataSource = objDataTable
To keep pace with competitors, businesses must keep employees productive, and that means providing them with the latest technology. This document provides the tips and tricks you need to help you migrate an outdated PC fleet to new desktops, laptops, and tablets.
This article explains how to create and use a custom WaterMark textbox class. The custom WaterMark textbox class allows you to set the WaterMark Background Color and WaterMark text at design time.
IMAGE OF WATERMARKS
Create VB …
Since .Net 2.0, Visual Basic has made it easy to create a splash screen and set it via the "Splash Screen" drop down in the Project Properties. A splash screen set in this manner is automatically created, displayed and closed by the framework itsel…
Microsoft Active Directory, the widely used IT infrastructure, is known for its high risk of credential theft. The best way to test your Active Directory’s vulnerabilities to pass-the-ticket, pass-the-hash, privilege escalation, and malware attacks …
Nobody understands Phishing better than an anti-spam company. That’s why we are providing Phishing Awareness Training to our customers.
According to a report by Verizon, only 3% of targeted users report malicious emails to management. With compan…