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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 2, 20262026-06-02T11:35:35+00:00 2026-06-02T11:35:35+00:00

Hi I am having a telerik GridView in my WPF application. In that grid

  • 0

Hi I am having a telerik GridView in my WPF application. In that grid i am having three columns like Number, Max and Min. Now I need to disable the Min and Max Cells When i will give some value on the Number column for a selected row.

I declared two variables like MaxCell and MinCell as GridViewCellBase. If The Query(Mentioned below for Getting MaxCell and MinCell) will return null value, I am not able to give IsEnabled as False. Its not accepting any value . Its giving Null reference Exception.
How can i solve this problem ? can any Please tell me the solution of this problem? Thanks in Advance.

       foreach (GridViewCell cell in row.Cells)
         {
             if (cell.Column.Header.ToString() == "Number" && Convert.ToInt32  (cell.Value) > 0)
             {
                 GridViewCellBase MaxCell = new GridViewCellBase();
                 GridViewCellBase MinCell=new GridViewCellBase();
                 MaxCell=(from c in row.Cells
                                    where c.Column.Name == "Max"
                                    select c).FirstOrDefault();
                 MinCell =(from c in row.Cells
                                     where c.Column.Name == "Min"
                                     select c).FirstOrDefault();

                 MaxCell.IsEnabled = false;// Here I am getting the null reference  exception when MaxCell and MinCell having empty values


                 MinCell.IsEnabled = false; 
                 break;
             }


         }

The MaxCell always returning empty value only. So i cant give the IsEnabled property. Now my doubt is, Why the MaxCell value is always coming as empty or null value? The cells are having the column like “Max” and “Min”. Then it should return the Actual Cell but Why its always returning null value?

  • 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-02T11:35:45+00:00Added an answer on June 2, 2026 at 11:35 am

    Instead of using approach you’ve described. I would try modifying cell style of particular columns and create a binding on IsEnabled property with converter that is returning appropriate value.

    <Style x:Key="MinMaxCellStyle" TargetType="{x:Type GridView:GridViewCell}">                        
          <Setter Property="IsEnabled" Value="{Binding Normal, Converter{StaticResources NormalToEnabledConverter}" />
    </Style>
    

    Then Apply this style to specific columns as fallows:

    <GridView:GridViewDataColumn CellStyle="{StaticResource MinMaxCellStyle}" />
    

    If you don’t like this you can always use triggers.

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

Sidebar

Related Questions

I'm using telerik mvc grid and bound my columns throuugh Data Table, I having
I have a grid that is currently using Telerik Grids, I would like to
I am using a Telerik GridView , and having an issue trying to sort
i have this line of code in my view using the Telerik Grid: columns.Bound(o
I have a Telerik RadGrid. The initial DataSource that is bound to the grid
I am using the Telerik MVC Grid with Ajax binding, and am having a
I am using the Telerik MVC grid, with Ajax data binding. I would like
I am having an issue with the paging system on Telerik's RadGrid (AJAX). First
Having volunteered to maintain a stagnant CPAN package (GnuPG) I'd like improve the install
Having trouble with proper regex for RewriteCond RewriteCond %{REQUEST_URI} !^/foo/ Works as expected, that

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.