Usercontrol from SfMultiColumnDropDownControl don't select the selected value.

Hi
i have extende the SfMultiColumnDropDownControl . But now don't select the selected value.
Where i wrong?

Tnx in Advance

Alessandro

Attachment: SfMultiTest_419d5064.7z

5 Replies

GT Gnanasownthari Thirugnanam Syncfusion Team February 15, 2018 01:57 PM UTC

Hi Marco, 

We have suspect your requirement, you had tried to set the SelectedIndex for extended SfMultiColumnDropDownControl. Now you can set the SelectedIndex like below code example. 

  <local:ExtendedSfMulti SelectedIndex="2" DisplayMember="PB" ValueMember="PA" /> 

We have modified the sample based on your requirement, you can download it from below mentioned location. 


You can refer the below UG links for more details about ValueMember and DisplayMember. 

If your requirement is different from our suspicion kindly share more details about your requirement like screenshot or video illustration, sample that will be helpful to provide appropriate solution at the earliest. 

Regards, 
Gnanasownthari T. 



MA Marco February 15, 2018 06:15 PM UTC

Hello, I apologize for the bad explanation.
I have attached a new example.
I have to create a series of my ExtendedSfMulti, each with its Model and columns.
The MainPage contains a collection of data, these contain the value to be selected in the drop down. ExtendedSfMulti without the implementation of the viewmodel works fine, but if implemented the viewmodel does not select the value in the dropdown.
Thanks in advance.

Attachment: SfMultiTest_23db84d1.7z


MK Muthukumar Kalyanasundaram Syncfusion Team February 19, 2018 07:20 AM UTC

Hi Marco, 

On your attached sample, you have bound the SelectedValue property with the DataContext of the MainWindow but the source is not defined in the binding, causes the path is tried to get the value from the DataContext of the ExtendedSfMulti02 and ExtendedSfMulti01 controls and it doesn’t return the value due to its unavailability in the corresponding ViewModel of the control. Now, we have resolved the reported issue by defining the source of the SelecteValue property when its bind with the property of different ViewModel. Please find the code snippet from below for the changes and make sure to define the source for the binding when it is referring property path is not defined in the same model of the control.   

Code Snippet: XAML 
 
<Window.Resources> 
    <local:ViewModelBase x:Key=" viewModelBase"/> 
</Window.Resources> 
 
<Grid> 
    <StackPanel Orientation="Vertical" HorizontalAlignment="Left" Width="416" > 
        <TextBox>Custom control 1 WITH VIEWMODEL:</TextBox> 
       <local:ExtendedSfMulti01 SelectedValue="{Binding Source={StaticResource viewModelBase}, Path=MasterCollection.A}" DisplayMember="PC" ValueMember="PA" /> 
        <TextBox>Custom control 2 WITH VIEWMODEL:</TextBox> 
        <local:ExtendedSfMulti02 SelectedValue="{Binding Source={StaticResource viewModelBase}, Path=MasterCollection.B}" DisplayMember="WC" ValueMember="WA" /> 
        <TextBox>Custom control WITHOUT VIEWMODEL:</TextBox> 
        <local:ExtendedSfMultiNOVM SelectedValue="{Binding Source={StaticResource viewModelBase}, Path=MasterCollection.C}" DisplayMember="PC" ValueMember="PA" /> 
    </StackPanel> 
</Grid> 


Please let us know if you have any concerns. 

Regards, 
Muthukumar K 



MA Marco February 19, 2018 09:51 AM UTC

Ok now work fine and I understand the problem, thanks a lot!


JG Jai Ganesh S Syncfusion Team February 20, 2018 03:49 AM UTC

Hi Marco, 
Thank you for the update. 
Please let us know if you need further assistance on this. 
Regards, 
Jai Ganesh S 


Loader.
Up arrow icon