Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6533487
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 25, 20262026-05-25T10:07:58+00:00 2026-05-25T10:07:58+00:00

I have a gridview controller with a set of BoundField columns to my data

  • 0

I have a gridview controller with a set of BoundField columns to my data source. I also have a CheckBoxField that I want checked depending on if that row in the table I get from the database is marked accordingly. The problem is, Oracle does not have a boolean type and ASP.NET is expecting a boolean to mark the check box. Is there some sort of work around for this?

Here is my gridview with the check box column.

<asp:GridView ID="DeviceGridView" runat="server" CssClass="SmallGridView"  
       DataSourceID="DeviceDataSource" AutoGenerateColumns="False" 
       EmptyDataText="No devices found." CellPadding="4" ForeColor="#333333" 
       GridLines="None"  OnRowCreated="GridView_RowCreated" 
       OnRowDataBound="GridView_RowDataBound"  >
    <FooterStyle CssClass="gridViewFooter" />
    <RowStyle CssClass="gridViewRow" />
    <EditRowStyle CssClass="gridViewEditRow" />
    <SelectedRowStyle CssClass="gridViewSelectedRow" />
    <HeaderStyle CssClass="gridViewHeader" />
    <AlternatingRowStyle CssClass="gridViewAltRow" />
    <Columns>
        <asp:BoundField HeaderText="DeviceID" DataField="device_id" />
        <asp:BoundField HeaderText="Device Type" DataField="device_type" />
        <asp:BoundField HeaderText="Description" DataField="description" />
        <asp:BoundField HeaderText="Enable Logging" DataField="enable_logging" />
        <asp:CheckBoxField DataField="normal_toggle" Text="Normal User Logging" />
    </Columns>
 </asp:GridView>
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-25T10:07:59+00:00Added an answer on May 25, 2026 at 10:07 am

    Instead of using <asp:CheckBoxField>, try using a template field:

    <asp:TemplateField>
        <ItemTemplate>
            <asp:CheckBox ID="cb" runat="server" 
                          Checked='<%# Eval("normal_toggle") == 1 %>' 
                          AutoPostBack="true" 
                          OnCheckedChanged="YourCheckedChangedEvent"/>
        </ItemTemplate>
    </asp:TemplateField>
    

    That will make your checkbox checked if normal_toggle value equals 1 and unchecked otherwise. Adjust to your data accordingly.

    Update

    Added an event to the <asp:Checkbox> inside the template field.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a Gridview boundfield where i set ReadOnly to true because i don't
I have GridView that allows select. It takes data from EntityDataSource . How do
I have gridview that I am using paging on. I want to pass along
I have GridView with connected SqlDataSource and I want cancel updating row when my
I have gridview which has columns of data and a button below the Apply
I have GridView which I can select a row. I then have a button
Have a gridview control which will show X amount of rows. I want to
I have a GridView control in an Asp.net application, that has a <asp:buttonField> of
I have a GridView defined like this: <asp:GridView ID=myGridView ruant=server> <asp:BoundField DataField=myField /> <asp:CommandField
I have a GridView that I would like to bind to an ObjectDataSource. I

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.