Click here to Skip to main content
14,690,505 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hi
In AutCompleteBox i'm Displaying multiple items with check box. if i'm choosing more than two items in autocompletebox, i concatenate the selected items and show as selected text of AutoCompleteBox.

c# code:
public void SetString()
       {
           string str = "";
           foreach (RecurDays item in ObjSchldRecurDaysList)
           {
               if (item.IsChecked)
               {
                   str = str + item.SchldDayDesc.Substring(0, 3) + ",";
               }
           }
           if (str != "")
               str = str.Substring(0, str.Length - 1);
           SchldRecurDaysText = str;
       }



xaml code:

<cc:IDAutoComplete Name="tbxRecurOn1001" Grid.Row="10" Grid.Column="5"

                                       Text="{Binding SchldRecurDaysText, Mode=TwoWay}" ItemsSource="{Binding ObjSchldRecurDaysList,Mode=TwoWay}"

                                       SelectedItem="{Binding ObjSchldRecurDaysSelectedData,Mode=TwoWay}"

                        <cc:IDAutoComplete.ItemTemplate>
                            <DataTemplate>
                                <CheckBox  Name="checkbox" Content="{Binding SchldDayDesc,Mode=OneWay}" HorizontalAlignment="Stretch" HorizontalContentAlignment="Stretch"

                                               IsChecked="{Binding Path=IsChecked, Mode=TwoWay}" MinWidth="150"

                                               FontStyle="Normal" Foreground="Black" >
                                </CheckBox>
                            </DataTemplate>
                        </cc:IDAutoComplete.ItemTemplate>
                    </cc:IDAutoComplete>


The Text Value get value as "Mon,Tue,wed" but it is not displyed in View. please help me....
Posted

public string SchldRecurDaysText
       {
           get { return _SchldRecurDaysText; }
           set
           {
               _SchldRecurDaysText = value;
               Notify("SchldRecurDaysText");
           }
       }


protected void Notify(string propertyName)
       {
           ConfirmPropertyName(propertyName);

           if (propertyChanged != null)
           {
              propertyChanged(this, new PropertyChangedEventArgs(propertyName));
           }
       }
   

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)




CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900