SelectedItems not working

Hi everybody :-)

I need again your help!

I want to use the SfTextBoxExt to select different Tags. But I cannot get SelectedItems working.

So far I have this:

<syncfusion:SfTextBoxExt AutoCompleteMode="Suggest"
                                             AutoCompleteSource="{Binding Tags_All}"
                                             MultiSelectMode="Token"
                                             SearchItemPath="Tag"
                                             SelectedItems="{Binding SelectedTest.Tags}"/>

With a custom business class TestItem.

using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace TestApp
{
    public class TestItem : INotifyPropertyChanged
    {
        public TestItem ()
        {
              Tags = new List<object>();
        }

        private string _GUID;
        private List<object> _Tags;

        public string GUID
        {
            get { return _GUID; }
            set
            {
                _GUID = value;
                OnPropertyChanged("GUID");
            }
        }
        public List<object> Tags
        {
            get { return _Tags; }
            set
            {
                _Tags= value;
                OnPropertyChanged("Tags");
            }
        }

        #region:PropertyChangedEvent
        public event PropertyChangedEventHandler PropertyChanged;

        public void OnPropertyChanged(string propertyName)
        {
            var handler = PropertyChanged;

            if (handler != null)
            {
                PropertyChanged(this, new PropertyChangedEventArgs(propertyName));
            }
        }
        #endregion
    }
}

No if I select a different Item in a SfDataGrid I want to show the Tags behind this Item.

How can I accieve this or am I doing something completely wrong.

Thank you very much!

Victor

8 Replies 1 reply marked as answer

SS Suganya Sethuraman Syncfusion Team July 6, 2020 12:35 PM UTC

Hi Victor,  
 
Greetings from Syncfusion.  
 
Currently we are validating the reported issue with provided information and we will let know the complete details on July 8th, 2020.  
 
We appreciate your patience until then.  
 
Regards,  
Suganya S 
 



SS Suganya Sethuraman Syncfusion Team July 8, 2020 10:50 AM UTC

Hi Victor, 
 
We have prepared a sample based on the code snippet provided. The reported issue was not reproduced in our side. Please use the below sample, 
 
 
Please check if the sample satisfies your requirement and if not provide additional details like pictorial representation of your requirement which will be helpful for us to provide the solution at the earliest. 
 
Regards,  
Suganya Sethuraman 



VD Victor Dienstbier July 9, 2020 07:25 PM UTC

Hi!

Thanks for the reply but if I try to download the example an error is show and I cannot download it :-(

Maybe you can upload it again?

I also have created a video and a GIF to show you what I mean. I want to select another item in the list on the left and then change the view on the right depending on the selection. But so far the Header works and the subtitle works too. Only the Selected Items from the SfTextBoxExt do not change and alway stay the same :-(

I hope it's now clear, what I mean :-)

Best wishes and thanks a lot for your help!


Victor

Attachment: Example_Video_50075602.zip


SS Suganya Sethuraman Syncfusion Team July 10, 2020 01:49 PM UTC

Hi Victor, 
 
We have prepared a sample based on the video provided. We have maintained the "SelectedItems" ViewModel property. This property was updated when SelectionChanged in DataGrid. This SelectedItem ViewModel property binds to the “SelectedItems” property of TextBoxExt. Please have the following sample. 
 
 
Please check if the sample satisfies your requirement and if not provide additional details like pictorial representation of your requirement which will be helpful for us to provide the solution at the earliest.  
 
Regards, 
Suganya Sethuraman 



VD Victor Dienstbier July 13, 2020 05:43 PM UTC

Hi Suganya,

thanks so much for your help! Unfortunately it's not what I want, because I don't want to select one item on the left and show the same item in the TextBox. I would like to select an item in the list on the left and then select different items in the TextBox for Example:

Select "Test 1" in the list. Then select in the TextBox "Order #1" and "Order #5" and "Order #22".
Select "Test 2" in the list. Then select in the TextBox "Order #99" and "Order #7"

and so on


Do you know what I mean?

Thank you very much :-)


Victor


SS Suganya Sethuraman Syncfusion Team July 14, 2020 11:54 AM UTC

Hi Victor,  
 
We have prepared sample based on your requirement. Please have the updated sample, 
 
 
Please check if the sample satisfies your requirement and if not provide additional details like pictorial representation of your requirement which will be helpful for us to provide the solution at the earliest. 
 
Regards, 
Suganya Sethuraman 



VD Victor Dienstbier July 23, 2020 08:13 PM UTC

Hi Suganya,

we are almost there :) I saw, that you are adding the items in code behind to each selected item. Why isn't this working as every other collection, when I select another item, the UI element gets the new items?

For a workaround that should do the job, but when I delete on of the items in the TextBox by clicking the 'x' the item doesn't get deleted. I would then have to save the items from the TextBox to a List in the Business class and load this after selection changed... Another workaround but for now that will definately help :-)

Do you plan to implement the selection change event to the TextBox in the future? Because if I would do this with two SfDataGrids that would work without a work around... Do you knwo what I mean?

Thank you very much for your help!


Victor


SS Suganya Sethuraman Syncfusion Team July 24, 2020 09:32 AM UTC

Hi Victor,

Query 1:
By clicking the 'x' button the item doesn't get deleted

We have checked the reported issue.
Unfortunately, we could not reproduce the issue. Could you please check with the below sample for the same, if the issue still exists could you please modify the above sample with the issue reproducing steps that will be easier for us to provide the solution at the earliest.

Query 2:
Save the items from the TextBox

We have maintained
SelectedItems property in ViewModel. If you want to use SelectedItems when you change your selection, please use the SelectedItems(ViewModel) property.

Query 3:Do you plan to implement the selection change event to the TextBox in the future?

SelectionChanged event is a framework event of MS TextBox.
We have maintained “SelectedItemChanged” event for selection in SfTextBoxExt.. Please use “SelectedItemChanged” event to get the SelectedItems.

Please have the updated sample,

SampleLink: https://www.syncfusion.com/downloads/support/directtrac/general/ze/TextBoxExtDataGrid-1872995719

Please let us know if you have any concerns.

Regards,

Suganya Sethuraman  


Marked as answer
Loader.
Up arrow icon