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

Check box enabled in GridView?

How do you enable a check box in the GridView. I selected Checkbox Field in
the Columns of the GridView, and the check box shows up in the Grid view, but
it is disabled. How do I enable it so I can check/uncheck it. Also, what
event do I use to check it for a value? Any articles out there?
--
Chris Davoli

Aug 2 '06 #1
2 3570
Hi Chris,

Could you show the code that's giving you trouble? Did you happen to set
something as read-only?

Ken
Microsoft MVP [ASP.NET]

"Chris Davoli" <Ch*********@discussions.microsoft.comwrote in message
news:DF**********************************@microsof t.com...
How do you enable a check box in the GridView. I selected Checkbox Field
in
the Columns of the GridView, and the check box shows up in the Grid view,
but
it is disabled. How do I enable it so I can check/uncheck it. Also, what
event do I use to check it for a value? Any articles out there?
--
Chris Davoli

Aug 2 '06 #2
Here is the code. I tried it two ways. One with a check box field and one
with a template and I dragged a check box over to the GridView. For the Check
box field it is set to read only. The template field lets me check/uncheck,
but There is nowhere to specify the data field. Where do I specify the Data
field with a template field?

Also, I know how to use the old DataGrid, but since the Gridview replaces
DataGrid, and the events are different, what are similar events for
Item_Command and Item_DataBound from the DataGrid, for the GridView? I found
RowCommand and RowDataBound. Are these the same? Do you have some snippets of
code to use to check a cell ie; e.Cells(0).Text like in the data grid to see
what the result of someone checking checkboxes in the GridView? I need code
snippets for DataBound before displaying and also after they check a box. Can
you refer me to some good articles?
<asp:GridView ID="dgApproval" runat="server"
AutoGenerateColumns="False" AllowPaging="True" AllowSorting="True">
<Columns>
<asp:BoundField DataField="Suffix" HeaderText="Suffix" />
<asp:BoundField DataField="FirstName" HeaderText="First
Name" />
<asp:BoundField DataField="LastName" HeaderText="Last
Name" />
<asp:TemplateField HeaderText="Is Approved By Physician
Relations">
<ItemStyle HorizontalAlign="Center" />
<ItemTemplate>
<asp:CheckBox ID="CheckBox1" runat="server"
AutoPostBack="True" Text="Approved" />
</ItemTemplate>
</asp:TemplateField>
<asp:CheckBoxField
DataField="IsApprovedByPhysicianRelations" ReadOnly="false" HeaderText="Is
Approved By Physician Relations2" />
<asp:BoundField DataField="MI" HeaderText="MI" />
<asp:BoundField DataField="Practice"
HeaderText="Practice" />
<asp:BoundField DataField="EmailAddress"
HeaderText="Email Address" />
<asp:BoundField DataField="Degree" HeaderText="Degree" />
<asp:BoundField DataField="Phone" HeaderText="Phone" />
<asp:BoundField DataField="Fax" HeaderText="Fax" />
<asp:BoundField DataField="Speciality"
HeaderText="Speciality" />
</Columns>
</asp:GridView>

--
Chris Davoli

"Ken Cox [Microsoft MVP]" wrote:
Hi Chris,

Could you show the code that's giving you trouble? Did you happen to set
something as read-only?

Ken
Microsoft MVP [ASP.NET]

"Chris Davoli" <Ch*********@discussions.microsoft.comwrote in message
news:DF**********************************@microsof t.com...
How do you enable a check box in the GridView. I selected Checkbox Field
in
the Columns of the GridView, and the check box shows up in the Grid view,
but
it is disabled. How do I enable it so I can check/uncheck it. Also, what
event do I use to check it for a value? Any articles out there?
--
Chris Davoli


Aug 3 '06 #3

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

Similar topics

0
by: rodchar | last post by:
hey all, i have a web form that has 5 link buttons on it that are for record updates (Edit, Cancel, Delete, New, Save). These buttons will serve 2 different controls which are the formView and...
2
by: shapper | last post by:
Hello, I have a CheckBoxField in my GridView but it is disabled. I need to make it enable so that the user can set that data field to true or false. Then on a click of a button I would need...
4
by: ma | last post by:
Hello, I have a GrideView that has 4 col. 3 of them are bound to a dataset and the last one is not. The last one is check box. The check box is defined as follow: <asp:TemplateField...
2
by: wildman | last post by:
RE: Gridview textbox has data check without postback.. javascript? I have a gridview with a textbox. I can set the textbox to autopostback and check for a value in a prerender event to decide if...
2
by: =?Utf-8?B?UGhpbCBKb2huc29u?= | last post by:
Hello, I have an asp.net 2.0 gridview with the paging enabled. I don't want to display the footer, but it always displays with the page numbers displayed. I have set the grid's showfooter to...
1
Frinavale
by: Frinavale | last post by:
I'm working on an ASP.NET application using VB.NET for server side code. I have a GridView listing a bunch of stuff. Above the GridView I have a checkbox named "ChkBx_SelectAll". If this...
5
by: =?Utf-8?B?U2F2dm91bGlkaXMgSW9yZGFuaXM=?= | last post by:
Can I set the Enabled or Visible properties of the controls (textboxes, checkboxes) displayed by default in edit mode, depending on the value of some other column? Or must I convert the column to a...
3
by: =?Utf-8?B?Qkw=?= | last post by:
if (Request.Browser.Cookies) { // Cookies supported } else { // Web browser not supports cookies }
9
by: ally | last post by:
Hi, I am programmatically binding gridview to a datatable. I want to hide 2 columns. I can be done by adding code in RowCreated event of gridview like e.Row.Cells.Visible = false; ...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
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?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
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
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...
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
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

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.