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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 9, 20262026-06-09T14:14:13+00:00 2026-06-09T14:14:13+00:00

On a row inside of a datagrid, I’m trying to disable a cell/field if

  • 0

On a row inside of a datagrid, I’m trying to disable a cell/field if the cell next to it is being used or vice verse. In other words the user can only enter one or the other, if the user enters info into one cell the other should be disabled or readonly or something. How can I achieve this? Can I somehow create a converter? At the same time the user should be able to zero out that cell in case he didn’t mean to enter info in that cell. Any advice is much appreciated.

 <DataGridTextColoumn Binding="{Binding Property1}" Header="Property1" />
 <DataGridTextColoumn Binding="{Binding Property2}" Header="Property2" />

-So if i enter info into property1 cell then i shouldn’t be able to enter anything into property2 cell. If i enter something into property2 cell then I shouldn’t be able to enter anything into property1 cell.

  • 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-09T14:14:14+00:00Added an answer on June 9, 2026 at 2:14 pm

    A converter could work (as you mentioned). Something like this

    <Window 
        ...
        xmlns:c="clr-namespace:*YourConverter'sNamespace*"
        ...
        />
    <Window.Resources>
        <c:NotBlankConverter x:Key="NotBlankConverter"/>
    </Window.Resources>
    ...
    <DataGridTextColoumn 
        Binding="{Binding Property1}" 
        Header="Property1" 
        IsReadOnly="{Binding Property2, Converter={StaticResource NotBlankConverter}"
        />
    ...
    

    Where your converter can look something like this

    class NotBlankConverter: IValueConverter
    {
        public object Convert(object value, Type targetType, object parameter, System.Globalization.CultureInfo culture)
        {
            return string.IsNullOrEmpty(value);
        }
        ...
    }
    

    Update

    It appears this actually will not work because of the way the IsReadOnly DP works for the DataGridTextColumn. To have a complete working solution, something from these questions needs to be implemented…

    .Net v4 DataGridTextColumn.IsReadOnly seems to be faulty

    DataGridTextColumn – How to bind IsReadonly?

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

Sidebar

Related Questions

I am trying to get columns inside row. But I only want to get
I am trying to inject inside repeaters items, the problem is that the row
I have a wpf toolkit datagrid with a few columns, then inside the row
iam trying to style an Row inside an DojoX (1.2.3) Grid depending on values
I'm trying to replicate the same event you can do inside ms access datagrid
I'm trying to show a windows forms tooltip inside a datagrid to highlight an
I have a Datagrid and inside it's row details template I have another Datagrid
I have a drop down box for each row inside a table <table> <tr>
Is there a way to only print or output 10 elements per row inside
For every comma inside a certain MYSQL row, I want to create x html

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.