Skip to content

Bits of .NET

Daily micro-tips for C#, SQL, performance, and scalable backend engineering.

  • Asp.Net Core
  • C#
  • SQL
  • JavaScript
  • CSS
  • About
  • ErcanOPAK.com
ASP.Net WebForms / C# / Devexpress

ASPxGridView – Disable CheckBox based on condition in GridViewCommandColumn

- 20.11.19 | 27.11.19 - ErcanOPAK

You can use code below:

protected void ASPxGridView1_CommandButtonInitialize(object sender, ASPxGridViewCommandButtonEventArgs e)
    {
        ASPxGridView grid = (sender as ASPxGridView);
        if (e.ButtonType == ColumnCommandButtonType.SelectCheckbox)
        {
            if(grid.GetRowValues(e.VisibleIndex, "ID").ToString() == "1")
            {
                e.Enabled = false;
            }
            else
            {
                e.Enabled = true;
            }
        }
    }

Related posts:

What is the difference between HashSet and List in .net?

Navigate to a Div using a button in HTML

C# Memory Leak: Event Handlers Never Unsubscribe

Post Views: 370

Post navigation

List all Foreign Keys referencing a given table in SQL Server
sp_help for SQL Server Management Studio

Leave a Reply Cancel reply

Your email address will not be published. Required fields are marked *

December 2025
M T W T F S S
1234567
891011121314
15161718192021
22232425262728
293031  
« Nov    

Most Viewed Posts

  • Get the User Name and Domain Name from an Email Address in SQL (915)
  • Get the First and Last Word from a String or Sentence in SQL (798)
  • How to select distinct rows in a datatable in C# (772)
  • How to add default value for Entity Framework migrations for DateTime and Bool (772)
  • How to make theater mode the default for Youtube (586)
  • Add Constraint to SQL Table to ensure email contains @ (558)
  • How to enable, disable and check if Service Broker is enabled on a database in SQL Server (532)
  • Average of all values in a column that are not zero in SQL (505)
  • Find numbers with more than two decimal places in SQL (421)
  • How to use Map Mode for Vertical Scroll Mode in Visual Studio (416)

Recent Posts

  • VS “Breakpoints Hit Wrong Line” — The PDB Stale Cache Bug
  • WP “Menus Not Saving” — The Max Input Vars Killer
  • Windows 11 “Search Bar Broken or Empty” — Rebuild Index the RIGHT Way
  • Windows 11 “UI Stuttering” — The Hidden Hardware Accelerated GPU Scheduling Bug
  • AJAX “POST Works Locally but Not in Production” — HTTPS Mixed Content
  • JS “setInterval Drift” — Why Your Timers Run Slower Over Time
  • HTML5 “Broken Autofill Styles” — Chrome’s Yellow Background Bug
  • CSS “Z-Index Doesn’t Work!” — The Parent Stacking Context Curse
  • .NET Core “HttpClient Exhaustion” — Why Your API Suddenly Stops Responding
  • ASP.NET Core “Random 404 After Deploy” — Broken Routing Cache

Most Viewed Posts

  • Get the User Name and Domain Name from an Email Address in SQL (915)
  • Get the First and Last Word from a String or Sentence in SQL (798)
  • How to select distinct rows in a datatable in C# (772)
  • How to add default value for Entity Framework migrations for DateTime and Bool (772)
  • How to make theater mode the default for Youtube (586)

Recent Posts

  • VS “Breakpoints Hit Wrong Line” — The PDB Stale Cache Bug
  • WP “Menus Not Saving” — The Max Input Vars Killer
  • Windows 11 “Search Bar Broken or Empty” — Rebuild Index the RIGHT Way
  • Windows 11 “UI Stuttering” — The Hidden Hardware Accelerated GPU Scheduling Bug
  • AJAX “POST Works Locally but Not in Production” — HTTPS Mixed Content

Social

  • ErcanOPAK.com
  • GoodReads
  • LetterBoxD
  • Linkedin
  • The Blog
  • Twitter
© 2025 Bits of .NET | Built with Xblog Plus free WordPress theme by wpthemespace.com