Your Privacy Matters: We use our own and third-party cookies to improve your experience on our website. By continuing to use the website we understand that you accept their use. Cookie Policy
80
Button in each row in the last column in xamdatagrid
posted
I am trying to create a xamdatagrid with one button in each row. I have included a DelegateCommand instance into my data source and binded the data source to the grid. However, in the view I want to show a button in that column which is bound to the CanExecute and Execute commands of the delegateCommand present in my dataSource. Also alternatively, I tried creating a single Delagte Command in my view model without making it a part of my dataSource. I then created an unbound field in my xamdatagrid created a button in that unbound field. this button I bound it to the delegateCommand in the view model. On clicking this button some action takes place on the row where the button is and then the button gets disabled. It works fine for the first time but on changing selection in the grid the button gets enabled and some other button in some other row gets disabled. I am not sure why this is happening. It would be helpful if you could post something with a button in each row supposed to act on that partcicular DataRecord. Thanks in advance.
WpfApplication143.zip
Parents
No Data
Reply
  • 14517
    Offline posted

    Hello Sushma,

    I modified your sample to add an implemention for the Command in the Person object. When the command is executed, I disable the button. I also updated the sample to add columns to the grid and bind the grid to a view model which includes a collection of people. When I press the button for some rows those buttons become disabled. I am then able to select other rows without the button’s states changing.

    Please see my sample and let me know if this helps resolve you issue or you are still seeing a problem. My modified sample was tested on build 13.2.20132.2300 in NetAdvantage for WPF 2013 Volume 2.

    Let me know if you have any questions.

    Sincerely,

    Valerie

    Developer Support Supervisor - XAML

    Infragistics

    www.infragistics.com/support

    WpfApplication143-Mod.zip
Children