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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 26, 20262026-05-26T03:07:04+00:00 2026-05-26T03:07:04+00:00

I’m about to pull my hair out for something that is probably very simple.

  • 0

I’m about to pull my hair out for something that is probably very simple.

This is using the XtraGrid.

Let’s assume I have two columns and x number of rows, contained in one column is just a checkbox that I set with the columnedit property and the other is a value. I have a text box set to be the editor of this second value.

How can I set this up so that if I check the checkbox for that row, it will allow editing to the number in the value field next to it? I have the allowedit set to true for the checkbox column, but if I set the allowedit to true for the 2nd column in say the checkbox checkedchanged event handler, it will allow all of the cells in that column to be edited. I have no other properties like readonly set or anything like that.

How can I distinguish between a single cell in that column and activate the editor while leaving the others readonly based on that checkbox in the same row? I have a feeling it involves using ShowingEditor and CustomRowCellEdit, but I’m not sure how to set that up.

Could someone take me through what I would need to do in order to accomplish this? What settings do I need to put for the readonly/allowedit properties for this column and what would I need to put in those ShowingEditor/CustomRowCellEdit methods to do this? I’m really new at this so it is probably a really basic question, but I need some help! Some code examples for C# to determine which cell is selected would help me, but I just need to figure this out. Thanks!!!

  • 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-26T03:07:04+00:00Added an answer on May 26, 2026 at 3:07 am

    Yes your are right, you have to manage this by implementing the ShowingEditor Event

    This code for demonstration porpuses:

    First I bond the gridview1 to a RandomClass

    public class RandomClass
    {
        public bool AllowEdit { get; set; }
        public string Text { get; set; }
    
        public randomClass()
        {
            this.AllowEdit = true;
            Text = "Text1";
        }
    }
    

    then implement the ShowingEditor Event, Every time the gridview1 tries to open the editor for the second column it checks whether AllowEdit column checked or not and take action according to it

    private void gridView1_ShowingEditor(object sender, CancelEventArgs e)
    {
         if (gridView1.FocusedColumn.FieldName == "Text"
              && !IsAllowingEdit(gridView1, gridView1.FocusedRowHandle))
         {
           e.Cancel = true;
         }
    }
    
    private bool IsAllowingEdit(DevExpress.XtraGrid.Views.Grid.GridView view,int row)
    {
         try
         {
            bool val = Convert.ToBoolean(view.GetRowCellValue(row, "AllowEdit"));
            return val;
         }
         catch
         {
             return false;
         }
     }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm parsing an RSS feed that has an ’ in it. SimpleXML turns this
I know there's a lot of other questions out there that deal with this
That's pretty much it. I'm using Nokogiri to scrape a web page what has
I am reading a book about Javascript and jQuery and using one of the
I have a string like this: La Torre Eiffel paragonata all’Everest What PHP function
I am doing a simple coin flipping experiment for class that involves flipping a
I'm making a simple page using Google Maps API 3. My first. One marker
I have just tried to save a simple *.rtf file with some websites and
link Im having trouble converting the html entites into html characters, (&# 8217;) i
For some reason, after submitting a string like this Jack’s Spindle from a text

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.