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

GridViewImageColumn does not display image

3 Answers 62 Views
GridView
This is a migrated thread and some comments may be shown as answers.
Oliver
Top achievements
Rank 1
Oliver asked on 13 Mar 2012, 05:03 PM
Hi,

I have a RadGridView with a GridViewImageColumn, this column is map to a property of my object. Depending of the value of the property, I display 2 differents images. In my dialog, the users have two buttons, when the users click on a button, I change the value of the property of the current object and I switch the the next item in the list. The problem is that I have to call a rebind() to see my image but the rebind seem's to take some time and my users have to wait between each click.

Thank's

3 Answers, 1 is accepted

Sort by
0
Vlad
Telerik team
answered on 13 Mar 2012, 05:06 PM
Hi,

 Do you raise PropertyChanged for your data item when changing these images? 

Greetings,
Vlad
the Telerik team
Sharpen your .NET Ninja skills! Attend Q1 webinar week and get a chance to win a license! Book your seat now >>
0
Oliver
Top achievements
Rank 1
answered on 13 Mar 2012, 06:31 PM
Hi,

I'm not sure to understand what you saying but what I do is the following:

BtnClick
...
setItemStatus(elem, pStatus);

 

 

int curPos = radGridViewBilling.Items.CurrentPosition;

 

radGridViewBilling.SelectedItems.Clear();

radGridViewBilling.Rebind(); ===> Without this, I can't see the image in my grid <===

radGridViewBilling.Items.MoveCurrentToPosition(curPos);
...

        private void setItemStatus(ListElements pElem, ChangesStatus pStatus)
        {
            Guid theGuid = pElem.ElementGuids[(int)ClaimReferences.Visit];

            //Change item status.
            switch (pStatus)
            {
                case ChangesStatus.None :
                    pElem.Tag = null;
                    break;
                case ChangesStatus.Conciliate:
                    pElem.Tag = ConciliateUri;
                    break;
                case ChangesStatus.Rebill:
                    pElem.Tag = RebillUri;
                    break;           
            }           
        }

0
Vlad
Telerik team
answered on 14 Mar 2012, 07:41 AM
Hi,

Your data items should implement INotifyPropertyChanged interface and you should raise PropertChanged event when you change property values.

There is no other way to notify the UI in WPF!

Greetings,
Vlad
the Telerik team
Sharpen your .NET Ninja skills! Attend Q1 webinar week and get a chance to win a license! Book your seat now >>
Tags
GridView
Asked by
Oliver
Top achievements
Rank 1
Answers by
Vlad
Telerik team
Oliver
Top achievements
Rank 1
Share this question
or