473,387 Members | 1,501 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,387 software developers and data experts.

Need help with DataGrid in VB.net

I have a datagrid that I am populating, and on my tab and I have a
select/Deselect all checkboxes. The only column in my grid that is
readable is the first column and it is a bit field displaying
checkboxes. I want to cycle through and select/deselect the datagrid
items based on either the Select/Deselect checkboxes on the form.

Dim strSelect As String = "SELECT bUpdateToMaster, sEmployeeID,
sAddress, sCity, sState, sZip, sVoicePhone, sEmergContactPerson,
sEmergContactPhone, sEmergContactRel FROM tblPREE"

Dim strConnections As String
strConnections = "Data Source=" + DATASOURCE + ";Initial
Catalog=SIP_Time_Sheet;user id =" + USERID + "; password=" +
PASSWORD
' Create the SqlDataAdapter.
daEmp = New SqlDataAdapter(strSelect, strConnections)
daEmp.SelectCommand.CommandType = CommandType.Text
daEmp.SelectCommand.CommandText = strSelect

' Fill the DataSet.
dt_EmpApprove = New DataTable("tblpree")

daEmp.Fill(dt_EmpApprove)

' No loops, so I'm being lasy - Will come back and fix this
later
dt_EmpApprove.Columns.Item(0).ReadOnly = False
dt_EmpApprove.Columns.Item(1).ReadOnly = True
dt_EmpApprove.Columns.Item(2).ReadOnly = True
dt_EmpApprove.Columns.Item(3).ReadOnly = True
dt_EmpApprove.Columns.Item(4).ReadOnly = True
dt_EmpApprove.Columns.Item(5).ReadOnly = True
dt_EmpApprove.Columns.Item(6).ReadOnly = True
dt_EmpApprove.Columns.Item(7).ReadOnly = True
dt_EmpApprove.Columns.Item(8).ReadOnly = True
dt_EmpApprove.Columns.Item(9).ReadOnly = True

' Bind the DataGrid control to the dt_EmpApprove DataTable.
grdApprove.SetDataBinding(dt_EmpApprove, "")

Thanks,
Derek
Posted Via Usenet.com Premium Usenet Newsgroup Services
----------------------------------------------------------
** SPEED ** RETENTION ** COMPLETION ** ANONYMITY **
----------------------------------------------------------
http://www.usenet.com
Nov 20 '05 #1
0 948

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

11
by: Junkguy | last post by:
I need some help programmatically causing a row in a DataGrid to "flush" its contents to its bound data (in Visual Studio 6 using Windows Forms with C#). My issue is I want to send an update to...
0
by: MrNobody | last post by:
I am desperately in need of some help to get a summary row for my DataGrid. A summary row is just a row always on the bottom which has totals for certain columns. I have been able to find...
1
by: ericm1155 | last post by:
I am trying to display some information from a database in a form that displays one record per line. When the user clicks anywhere on a line, that record is highlighted and selected, and my program...
5
by: Luis E Valencia | last post by:
I need a link on a datagrid, the link must have fields of the database Like this acciones.aspx?iddireccion=1&idindicador=4 Thanks
1
by: Jennyfer J Barco | last post by:
Hello again I have a datagrid and I'm showing many records. I need 2 things: I need that everytime they scroll down, the header stays lock so the user can see it all the time. I need to scroll...
1
by: Anna | last post by:
I have a simple DataGrid that displays a list of characteristics and allows you to edit a description for each characteristic. The query that feeds this involves a join, as the characteristics and...
10
by: Terry Olsen | last post by:
I've got a datagrid set up to display data. I've also got an Edit,Update,Cancel column set up to allow editing of data. I've got a DropDownList (ID="ddl3")in the EditItemTemplate for a certain...
21
by: coleenholley | last post by:
I've been trying since last Friday to get an answer on how to get a SPECIFIC row.cell value from a datagrid. I've had plenty of suggestions, but nothing works to get the value from a SPECIFIC Row...
3
by: Larry Woods | last post by:
I have a datagrid that is carrying all fields of a record...except one. Now I want to update the underlying database via a dataadapter. The update is working but the field that is "left out" is...
0
by: Familjen Karlsson | last post by:
Hi I have downloaded some code and tried it and nothing happens with the datagrid. Explain what is wrong and what I have to do please. I have tried to Import the namespace Hamster and it didn't...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.