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 405059
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 12, 20262026-05-12T17:21:54+00:00 2026-05-12T17:21:54+00:00

I have little experience in C#.NET, and below is what I got so far:

  • 0

I have little experience in C#.NET, and below is what I got so far:

I created a DataGridView which bound to an ObjectDataSource(a generic list, that is).

Although I can make good use of the DataGridView’s CellClick event and its corresponding delegate interface(DataGridViewCellEventHandler) to do my business logic well, I am still
not happy with the overall logic.

Basically the drawback of the above approach is that for some certain columns, there’s no need to have a CellClick event bound to it. They are simply displaying info, not try to listen
to some CellClick events.

I’ve tried to achieve it for quite some time. I tried to disable such columns from being able to be clicked but got no luck…

Is there a good way go around this issue?

I really don’t want to check what’s the actual columnIndex in my delegate handler functions and then act accordingly. Basically, if the CellClick wouldn’t be triggered in the first place, then that would be an excellent solution.

Many thanks in advance!

  • 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-12T17:21:55+00:00Added an answer on May 12, 2026 at 5:21 pm

    @Ian, not entirely true…..If you really don’t want to do the filtering, which I don’t think is that big a deal to be honest. You can always create your own custom DataGridView and override the OnCellClick event. To make it even simpler you can set the columns you don’t want to raise the event for at design time to be ReadOnly and check for that condition before raising the event.

    Example:

    public class MyDataGridView : DataGridView
    {
         public MyDataGridView()
         {
         }
    
         protected override void OnCellClick(DataGridViewCellEventArgs e)
         {
              if (!Columns[e.ColumnIndex].ReadOnly)
              {
                   base.OnCellClick(e);
              }
         }
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have very little experience with ASP.NET and I am doing some self-training before
I am fairly new to asp.net, and have little experience with iis. I would
I have created my own Role Provider because I found the one that ASP.Net
I have very little experience with asp.net and need some help with a presumably
I've compiled C# code into a DLL, but have little experience with them. My
I have a little experience developing small command-line applications with Python. I want to
I have a little experience with WCF and would like to get your opinion/suggestion
I have very little experience working with sockets and multithreaded programming so to learn
I have very little experience using Sharepoint but a good amount using Visual Studio
Warning: I have very little JavsScript experience. In my past programming experience, I usually

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.