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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 1, 20262026-06-01T23:07:52+00:00 2026-06-01T23:07:52+00:00

Considering this code: <telerik:RadGridView ItemsSource={Binding SearchResults} RowDetailsVisibilityMode=VisibleWhenSelected> <telerik:RadGridView.Columns> <telerik:GridViewDataColumn Header=First Name DataMemberBinding={Binding FirstName} />

  • 0

Considering this code:

<telerik:RadGridView ItemsSource="{Binding SearchResults}" RowDetailsVisibilityMode="VisibleWhenSelected">
    <telerik:RadGridView.Columns>
        <telerik:GridViewDataColumn Header="First Name" DataMemberBinding="{Binding FirstName}"  />
        <telerik:GridViewDataColumn Header="Last Name" DataMemberBinding="{Binding LastName}"  />
    </telerik:RadGridView.Columns>
    <telerik:RadGridView.RowDetailsTemplate>
        <DataTemplate>
            <Button Command="{Binding OpenView1Command}">Open View 1</Button> <!-- This does not work -->
        </DataTemplate>
    </telerik:RadGridView.RowDetailsTemplate>
</telerik:RadGridView>

The OpenView1Command is defined in my ViewModel. How do I make the binding work?

  • 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-01T23:07:55+00:00Added an answer on June 1, 2026 at 11:07 pm

    ok, Michael, my previous answer works, so there is nothing wrong with Telerik , and to prove it, I coded this up, copy/paste/run:

    XAML:

    <Window x:Class="Sample.MainWindow"
        xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
        xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
         xmlns:telerik="http://schemas.telerik.com/2008/xaml/presentation"
        Height="350" Width="525" 
        x:Name="wnd">
    
    <telerik:RadGridView  ItemsSource="{Binding ViewModel.Items, ElementName=wnd}" 
                          AutoGenerateColumns="False"
                          RowDetailsVisibilityMode="VisibleWhenSelected">
        <telerik:RadGridView.Columns>
            <telerik:GridViewDataColumn Header="Name" DataMemberBinding="{Binding Name}"  />
        </telerik:RadGridView.Columns>
        <telerik:RadGridView.RowDetailsTemplate>
            <DataTemplate>
                <StackPanel Orientation="Horizontal"
                            Margin="10,10,10,10">
                    <TextBlock Text="This is my RowDetailsTemplate: " />
                    <Button Command="{Binding RelativeSource={RelativeSource FindAncestor, AncestorType={x:Type Window}}, Path=ViewModel.SomeCommand}">SomeCommand</Button>
                </StackPanel>
            </DataTemplate>
        </telerik:RadGridView.RowDetailsTemplate>
    </telerik:RadGridView>
    </Window>
    

    code behind:

    using System;
    using System.Collections.ObjectModel;
    using System.ComponentModel;
    using System.Windows;
    using Microsoft.Practices.Prism.Commands;
    
    namespace Sample
    {
    public partial class MainWindow : Window
    {
        public ViewModel ViewModel { get; set; }
    
        public MainWindow()
        {
            ViewModel = new ViewModel();
            ViewModel.PropertyChanged +=(o,e)=> 
            {
                if(e.PropertyName.Equals("Proof"))
                MessageBox.Show("Button Command Binding just worked!");
            };
    
            InitializeComponent();
    
        }
    }
    
    public class ViewModel : INotifyPropertyChanged
    {
        private ObservableCollection<SomeClass> _items;
        private DelegateCommand _someCmd;
        private bool _proof;
    
        public ObservableCollection<SomeClass> Items
        {
            get
            {
                if (_items == null)
                {
                    _items = new ObservableCollection<SomeClass>();
                    for (int i = 0; i < 1000; i++)
                        _items.Add(new    SomeClass(string.Format("name {0}", i)));
                }
    
                return _items;
            }
        }
        public DelegateCommand SomeCommand
        {
            get
            {
                return _someCmd ?? (_someCmd = new DelegateCommand(() =>
                                                                    {
                                                                        Console.WriteLine("Booya, binding works!");
                                                                        Proof = true;
                                                                    }));
            }
        }
    
        public bool Proof
        {
            get { return _proof; }
            set
            {
                _proof = value;
                RaisePropertyChanged("Proof");
            }
        }
    
    
        private void RaisePropertyChanged(string propertyName)
        {
            if (PropertyChanged != null)
                PropertyChanged(this, new PropertyChangedEventArgs(propertyName));
        }
    
        public event PropertyChangedEventHandler PropertyChanged;
    }
    
    public class SomeClass : INotifyPropertyChanged
    {
        private string _name;
    
        public SomeClass(string name) { _name = name;}
    
        public string Name
        {
            get { return _name; }
            set
            {
                if (_name == value)
                    return;
                _name = value;
                RaisePropertyChanged("Name");
            }
        }
    
        private void RaisePropertyChanged(string propertyName)
        {
            if(PropertyChanged != null)
                PropertyChanged(this, new PropertyChangedEventArgs(propertyName));
        }
    
        public event PropertyChangedEventHandler PropertyChanged;
    }
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Considering this code, can I be absolutely sure that the finally block always executes,
Considering this article Developing a MVC component for Joomla , following is the code
I apologize if this code looks a bit like a mess (considering the length);
Considering this code: std::vector<myObject*> veryLargeArray; for (int i = 0; i < veryLargeArray.size(); ++i)
This question is mystifying me for years and considering this site's name, this is
Considering this basic code snippet: <? class mcClassington { var $mcProperty='default'; function mcDoSomething() {
I set up my code without considering this fact needed to be detected, and
I have this code. I am trying to retrieve just the text first program.
Considering this code fragment: struct My { operator const char*()const{ return my; } }
Considering this sample code: <div style=width:300px;> <a href=#> <img src=images/bracket_open.png/> <img src=images/1.png/> <img src=images/bracket_close.png/>

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.