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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 17, 20262026-05-17T23:31:36+00:00 2026-05-17T23:31:36+00:00

I have a Data Grid and many buttons for commands on the selected item

  • 0

I have a Data Grid and many buttons for commands on the selected item in the data grid.

These buttons will be hidden or disabled based on properties in the selected item in the grid.

For example: if the selected record IsNew, the button Cancel will be disabled.

What’s the best practice to implement a situation like this?

I may implement it in the SelectedItemChange manually like the follwoing:

void myGrid_selectedItemChanged(sender, args..)
{
    cancelButton.IsEnabled = SelectedItem.IsNew ; // just an example
}

The problem with this approach is that, when the selected item is removed, this event will not be fired.

Or in XAML, bind a dependency property with the control:

<!--SelectedItemIsNew is a property in the form and binding it with IsEnabled... -->
<Button x:Name="cancelButton" IsEnabled="{Binding SelectedItemIsNew ...}"/>

The problem here, I must assign a value to the property to notify the bound control, or in other words what’s the code here to change the value of the property ?

Another option!

  • 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-17T23:31:36+00:00Added an answer on May 17, 2026 at 11:31 pm

    hey, i have the same case some time back, i always do that when ever i bind some data with grid or list in SL/WPF as it is easy and more understandable. why dont you try Binding coustom list to your code?? For examlple.. take and Filed like say String HyperLinkNaviagtion

    when you get values fro service then befor assigning list to your grid, iterate on all of your items and assign HyperLinkNaviagtion some value like

     if(SomeCondition)
        { 
          // navigaet to google
              HyperLinkNaviagtion ="www.google.com";
        } 
     else 
       { 
         // navigaet to yahoo
           HyperLinkNaviagtion ="www.yahoo.com";
       }
    

    and in Xaml, do the following

    NavigateUri=”{Binding HyperLinkNaviagtion }”

    It is don, you can control almost every thing like this =)
    this might be not the best but in my case it is easiest and tension free too .

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

Sidebar

Related Questions

I have a data grid that has a checkbox item renderer in a cloumn
I have a Data Grid View inside a control that is displayed in a
I have a neat little javascript data grid and I want people to be
I have a variety of time-series data stored on a more-or-less georeferenced grid, e.g.
I have a button with a working listener in an ExtJs Data Grid. I
I have one grid view control in my asp.net web application. For example i
I have a data grid and I am data bindding it to an array
Let’s say I have a data grid and there’s a method attached to clicking
Background : Applications that manipulate a collection of data typically present using a grid
Im using c# .net windows application form. I have created many databases with many

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.