This is a migrated thread and some comments may be shown as answers.

GridView SelectedItem Binding not working in my MVVM app

6 Answers 420 Views
GridView
This is a migrated thread and some comments may be shown as answers.
Rhyous
Top achievements
Rank 1
Rhyous asked on 18 May 2011, 06:56 PM
Hey all,

I am writing an installer. It has a list of commands to execute and I need to show the progress.  I have a quite complex application that I am really using, so I created a sample app.  At first I was using the regular .NET 4 WPF DataGrid, but the .NET 4 DataGrid just wan't behaving stable.  See my recent post on MSND: http://social.msdn.microsoft.com/Forums/en-US/wpf/thread/e4eeb10b-8b27-4b26-a435-baa0ae4ea47a/

Anyway, my company has licensed Telerik, I was told, so I thought I would try the Telerik GridView.

I replaced the DataGrid with the Telerik GridView but I can't really even get started because the SelectedItem is not changing when the bound value changes.  It is a readonly bound value and I have it set to mode=oneway.  While debugging the NotifyPropertyChanged("CurrentCommand") is properly called.  This is one part that was working fine with the DataGrid.

Here is my sample app: DataGridExecutionListWithTelerik.zip

My overall goal is to Execute each command.  I must also do the following:
1. Show a progress spinner (which isn't in my sample but is working in my actual app) on the current item.
2. There are so many commands, there is scrolling.  So when it reaches the commands not visible, the GridView should scroll (I am using ScrollIntoView).  Then I need current command inprogress to always be visible.  When finished the item should stay scrolled to the bottom.

I need the SelectedItem to change when it changes in my ViewModel so the event fires so the ScrollIntoView function can be called.

6 Answers, 1 is accepted

Sort by
0
Accepted
Dimitrina
Telerik team
answered on 19 May 2011, 12:56 PM
Hello Rhyous,

 The only change that you need to do in order to achieve your goal is to change the Mode of the binding to the SelectedItem to TwoWay. This way the SelectedItem is changing when the bound value changes.  Doing this, you should as well add a setter to the property CurrentCommand.

As I understand from your post, you already have the progress spinner working.

I hope that this is solving your problem. If you have another questions, please contact us.

Greetings,
Didie
the Telerik team
Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items
0
Rhyous
Top achievements
Rank 1
answered on 19 May 2011, 02:10 PM
That worked!

I can't actually let it change the value because in my "real project" that this is an example of the data is read-only.

So I just created an empty set{} function in the property.

Hopefully Telerik enhances their GridView to support mode=oneway as this is common.
0
Rhyous
Top achievements
Rank 1
answered on 19 May 2011, 02:43 PM
I tried to submit an enhancement request but it just kept re-routing me to search the forums.
0
Dimitrina
Telerik team
answered on 20 May 2011, 04:21 PM
Hi Rhyous,

Could you please share with us how you have tried to submit an enhancement request, so that we could investigate it further? 

Kind regards,
Didie
the Telerik team
Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items
0
Rhyous
Top achievements
Rank 1
answered on 20 May 2011, 05:12 PM
Sure.

What I click
I am in Firefox 4.0.1 on Win7 64 bit.
I went to Community & Support | Issue Tracker.
I clicked Rad Controls for WPF.
I clicked Feature Request.

Result
I get taken back to the Community & Support | Support Center. (I can tell be looking at the web page bred crumbs and by comparing just going directly there)

Expected Result
A page that allows me to submit an enhancement request.
0
Dimitrina
Telerik team
answered on 23 May 2011, 03:17 PM
Hi Rhyous,

Thank you for the details. 

Currently, you cannot submit a bug report or a feature request directly through our Public Issue Tracking System (PITS). First you should send us a description of the problem or the desired functionality. Then we will discuss it internally and decide whether we will include it in our development plans or not.

You can submit bug reports or feature requests through our Forums (this is why you were redirected) or if the license holder at your company adds you as a licensed developer you would be able to submit Bug Reports or Feature Request tickets directly to us.

Regards,
Didie
the Telerik team
Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items
Tags
GridView
Asked by
Rhyous
Top achievements
Rank 1
Answers by
Dimitrina
Telerik team
Rhyous
Top achievements
Rank 1
Share this question
or