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

  • Home
  • SEARCH
  • 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 9137623
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 17, 20262026-06-17T09:07:34+00:00 2026-06-17T09:07:34+00:00

I have 2 columns I’m working with in an XtraGrid. When Column1’s value changes,

  • 0

I have 2 columns I’m working with in an XtraGrid. When Column1’s value changes, I’d like to perform some logic and possibly change the value of Column2 and disable Column2 as well. You can see my code below, but I have 3 problems:

  1. My CustomRowCellEdit function seems to run non-stop in the background.
  2. The SetRowValue on Column2 doesn’t seem to really happen unless I click away from the row; I need the change to happen as soon as Column1 is changed.
  3. How can I disable within my IF block?

I’ve added the following Event to a Grid:

this._myGridView.CustomRowCellEdit += 
    new DevExpress.XtraGrid.Views.Grid.CustomRowCellEditEventHandler(
        this.myGridView_CustomRowCellEdit);

Here is the Event:

private void myGridView_CustomRowCellEdit(object sender, CustomRowCellEditEventArgs e)
{
    if (e.Column.FieldName == "Column1" && e.RowHandle >= 0)
    {
        GridView gv = sender as GridView;
        string value1 = gv.GetRowCellValue(e.RowHandle, gv.Columns["Column1"]).ToString();

        if (value1 == "something")
        {
            gv.SetRowCellValue(e.RowHandle, gv.Columns["Column2"], someOtherValue);
            // I'd like to disable Column2 in this IF logic.
        }
    }
}
  • 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-06-17T09:07:34+00:00Added an answer on June 17, 2026 at 9:07 am

    In the DevX docs, there is a note about the CustomRowCellEdit event that says

    Due to the XtraGrid control’s infrastructure, the CustomRowCellEdit event fires frequently – each time a cell is refreshed. Therefore, do not implement complex logic for your CustomRowCellEdit event handler…

    Given your stated requirements, my approach would be to use the CellValueChanged event instead of CustomRowCellEdit. Your handler could then say something like

    private void myGridView_CellValueChanged(object sender, CellValueChangedEventArgs e) {
        if (e.Column.FieldName != "Column1") return;
        GridView gv = sender as GridView;
        if (e.Value == "something") {
            gv.SetRowCellValue(e.RowHandle, gv.Columns["Column2"], someOtherValue);
        }
    }
    

    To make an individual cell non-editable at runtime, see this topic on the DevExpress support site.
    how to set readyonly for rows at runtime using Devxpress Grid Contorl.
    Essentially what you need to do is handle the grid view’s ShowingEditor event, and using the FocusedRowHandle and FocusedColumn properties, decide whether or not to allow editing for the current cell. To disable editing, set the Cancel property of the CancelEventArgs to true.

    Hope this helps.

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

Sidebar

Related Questions

I have a table products , and I have columns like product_name , product_id
I have two columns A and B, and would like to get a list
I have a Sharepoint list which have columns like : CopmanyName, Add1, Add2 Country,
Working in SSRS I have columns of values, totals for the month on various
So I have columns defined like this: <DataGridTemplateColumn.CellTemplate> <DataTemplate> <TextBox Text={Binding Path=COLUMN_NAME, Mode=TwoWay, UpdateSourceTrigger=PropertyChanged}
I have a formula like this: =COUNTBLANK(BA3:BA21771)/ROWS(BA3:BA21771) I have columns that extend all the
I have a dataframe of historical stock trades. The frame has columns like ['ticker',
I have a table in which i have columns like : ItemId Date CountUser
How to select like if I have columns with rows column row1 row1 row2
I have a table with products that have columns like this: price[decimals 8,5] and

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.