473,427 Members | 1,786 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,427 software developers and data experts.

datagrid controls

hi,

In my datagrid i have added the checkbox controls. Ihave done this with the help of "Template column". So now it creates as many check boxes depending upon the data's in my database. Now what i have done is , i have used a checkbox outside my datagrid. When i click this checkbox ie.. when this "checkbox.checked=true" then the checkboxes inside my datagrid should also be checked. I tried but could not find a solution.

I tried it this way

"" Dim dgitem As DataGridItem
Dim chkSelected As CheckBox

For Each dgitem In DataGrid1.Items
chkSelected = dgitem.FindControl("chkName")
If CheckBox1.Checked = True Then
chkSelected.Checked = True

End If

Next ""


while doing this ie when i check the checkbox outside the datagrid the check boxes inside ny datagrid is not getting enabled(checked).

help me to get a solution for this
Jan 23 '07 #1
3 2019
radcaesar
759 Expert 512MB
http://www.devx.com/tips/Tip/20238

hi,

In my datagrid i have added the checkbox controls. Ihave done this with the help of "Template column". So now it creates as many check boxes depending upon the data's in my database. Now what i have done is , i have used a checkbox outside my datagrid. When i click this checkbox ie.. when this "checkbox.checked=true" then the checkboxes inside my datagrid should also be checked. I tried but could not find a solution.

I tried it this way

"" Dim dgitem As DataGridItem
Dim chkSelected As CheckBox

For Each dgitem In DataGrid1.Items
chkSelected = dgitem.FindControl("chkName")
If CheckBox1.Checked = True Then
chkSelected.Checked = True

End If

Next ""


while doing this ie when i check the checkbox outside the datagrid the check boxes inside ny datagrid is not getting enabled(checked).

help me to get a solution for this
Jan 23 '07 #2
check this although its for grid view just see how it is used
http://aspnet.4guysfromrolla.com/articles/052406-1.aspx
Jan 23 '07 #3
enreil
86
Have you enabled postback on your checkbox outside the datagrid? Once you do that, make sure the code you posted is enclosed in that checkbox's checked_changed event. You should also make sure you cast your control to the CheckBox type. Try the following in the checked_changed event:

Dim dgitem As DataGridItem
Dim chkSelected As CheckBox

For Each dgitem In DataGrid1.Items
chkSelected = CType(dgitem.FindControl("chkName"), CheckBox)
chkSelected = CheckBox1.Checked
Next

hi,

In my datagrid i have added the checkbox controls. Ihave done this with the help of "Template column". So now it creates as many check boxes depending upon the data's in my database. Now what i have done is , i have used a checkbox outside my datagrid. When i click this checkbox ie.. when this "checkbox.checked=true" then the checkboxes inside my datagrid should also be checked. I tried but could not find a solution.

I tried it this way

"" Dim dgitem As DataGridItem
Dim chkSelected As CheckBox

For Each dgitem In DataGrid1.Items
chkSelected = dgitem.FindControl("chkName")
If CheckBox1.Checked = True Then
chkSelected.Checked = True

End If

Next ""


while doing this ie when i check the checkbox outside the datagrid the check boxes inside ny datagrid is not getting enabled(checked).

help me to get a solution for this
Jan 23 '07 #4

Sign in to post your reply or Sign up for a free account.

Similar topics

3
by: Jim Heavey | last post by:
Trying to figure out the technique which should be used to add rows to a datagrid. I am thinking that I would want an "Add" button on the footer, but I am not quite sure how to do that. Is that...
12
by: Daniel Walzenbach | last post by:
Hi, I want to display a Label in a DataGrid according to some condition. I therefore check whether the condition is true in the ItemDateBound EventHandler of the DataGrid. Unfortunately the...
9
by: tshad | last post by:
How do I find (and set) a couple of labels in the Footer after a DataGrid is filled? I have a bunch of DataGrids that get displayed nested inside a DataList. The datagrid looks like: ...
4
by: tshad | last post by:
I am having trouble with links in my DataGrid. I have Links all over my page set to smaller and they are consistant all over the page in both Mozilla and IE, except for the DataGrid. Here is a...
0
by: optimizeit | last post by:
What I am attempting to do is import an Excel Workbook and display the worksheets in a datagrid dynamically. I am very close to getting this to work. I have to this point successfully imported a...
1
by: jimb | last post by:
I can get the dropdownlist into the datagrid, and I can populate it, but I can't read it. Anybody have a working example of a dropdownlist in an editable grid? Thanks. -- .....
9
by: rn5a | last post by:
A Form has a DataGrid which displays records from a SQL Server 2005 DB table. Users can modify the records using this DataGrid for which I am using EditCommandColumn in the DataGrid. This is the...
0
by: rn5a | last post by:
Suppose I have the following DataGrid: <asp:DataGrid ID="dgUsers" OnUpdateCommand="UpdateDG" runat="server"> <Columns> <TemplateColumn HeaderText="NAME"> <ItemTemplate> <asp:Label...
0
by: arlie_maija | last post by:
Hey - I'm writing a control that contains a DataGrid, and I'm unable to get the update event to fire. When I click the update link, the edit event fires. heres the details... my control...
2
by: =?Utf-8?B?Y3JlYXZlczA2MjI=?= | last post by:
I have a nested datagrid in a xaml file, the parent datagrid loads the vendor information and the details loads the documents for that vendor in a datagrid. Everything is working fine until I click...
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,...
1
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...
0
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...
0
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The...
0
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?

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.