Hi,
With the following code i m facing the captioned problem.
Xaml:
<CollectionViewSource x:Key="v_EXSTDNT_MASTERViewSource" d:DesignSource="{d:DesignInstance my:V_EXSTDNT_MASTER, CreateList=True}">
<Grid DataContext="{StaticResource v_EXSTDNT_MASTERViewSource}" HorizontalAlignment="Left" Margin="33,104,0,0" Name="grid1" VerticalAlignment="Top" Height="35" Width="483"> <Grid.ColumnDefinitions> <ColumnDefinition Width="Auto" /> <ColumnDefinition Width="Auto" /> <ColumnDefinition Width="71*" /> </Grid.ColumnDefinitions> <Grid.RowDefinitions> <RowDefinition Height="35" /> <RowDefinition Height="695*" /> </Grid.RowDefinitions> <!--<Label Content="Select Student:" HorizontalAlignment="Left" Margin="49,81,0,588" VerticalAlignment="Center" Width="104" Grid.Row="1" />--> <ig:XamMultiColumnComboEditor Name="xamMultiColumnComboEditor1" DisplayMemberPath="NAME" SelectedItem="STDNT_CODE" HorizontalAlignment="Left" ItemsSource="{Binding}" Margin="131,3,0,3" VerticalAlignment="Center" Width="346" AutoGenerateColumns="False" IsTabStop="True" AllowMultipleSelection="False" Height="29" Grid.Column="2"> <ig:XamMultiColumnComboEditor.Columns> <ig:TextComboColumn HeaderText="Code" Key="STDNT_CODE"/> <ig:TextComboColumn HeaderText="Name" Key="NAME"/> <ig:TextComboColumn HeaderText="Father Name" Key="FATHER_NAME"/> <ig:TextComboColumn HeaderText="Date of Birth" Key="DATE_OF_BIRTH"/> <ig:TextComboColumn HeaderText="Place of Birth" Key="PLACE_OF_BIRTH"/> <ig:TextComboColumn HeaderText="Gender" Key="GENDER"/> </ig:XamMultiColumnComboEditor.Columns> </ig:XamMultiColumnComboEditor> </Grid>
Code Behind:
private ObjectQuery<V_EXSTDNT_MASTER> GetV_EXSTDNT_MASTERQuery(Entities entities) { // Auto generated code System.Data.Objects.ObjectQuery<ExStudentInfo.V_EXSTDNT_MASTER> v_EXSTDNT_MASTERQuery = entities.V_EXSTDNT_MASTER; // Returns an ObjectQuery. return v_EXSTDNT_MASTERQuery; } private void Window_Loaded(object sender, RoutedEventArgs e) { ExStudentInfo.Entities entities = new ExStudentInfo.Entities(); // Load data into V_EXSTDNT_MASTER. You can modify this code as needed. System.Windows.Data.CollectionViewSource v_EXSTDNT_MASTERViewSource = ((System.Windows.Data.CollectionViewSource)(this.FindResource("v_EXSTDNT_MASTERViewSource"))); System.Data.Objects.ObjectQuery<ExStudentInfo.V_EXSTDNT_MASTER> v_EXSTDNT_MASTERQuery = this.GetV_EXSTDNT_MASTERQuery(entities); v_EXSTDNT_MASTERViewSource.Source = v_EXSTDNT_MASTERQuery.Execute(System.Data.Objects.MergeOption.AppendOnly); }
Accessing the value:
//int selItem = this.xamMultiColumnComboEditor1.SelectedItem; listBox1.Items.Add(this.xamMultiColumnComboEditor1.SelectedIndex);listBox1.Items.Add(this.xamMultiColumnComboEditor1.SelectedItems);listBox1.Items.Add(this.xamMultiColumnComboEditor1.SelectedItem);
Result:
Also guide/alter the above code so that i get the xamMultiColumnComboEditor1 sorted for the Code field.
An early reply will be highly appreciated.
Regards,
Sohail Kazmi.
I guess everyone is busy helpin.
Hello,
I have been looking into your issue and I have created a sample application(MultiColumnComboEditorBinding.zip) according your description in order to test if this issue is due to our XamMultiColumnComboEditor and everything goes as expected. Would you please try to modify the application according to your specifications in order to reproduce the mentioned behavior, or send me an isolated one that already behaves as you pointed out ?
Looking forward to hearing from you.
Another problem i m facing is that the events are not exposed at designer. How i m going to write the events for the same?. In the image it is clear that the events tab is selected, but events are not exposed.
Thank you for your patience while our development team has been investigating the issue that you have decribed. After researching the designer issue with the XamComboEditor, it turns out that the reason designer to throw the error is an issue in Visual Studio. The Visual Studio issue is already been fixed and the fix will be available for Visual Stodio 11. Here is the link to the Visual Studio issue: http://connect.microsoft.com/VisualStudio/feedback/details/733963/visual-studio-wpf-designer-surface-crashes-when-deriving-a-control-from-a-generic-control-that-has-events-defined .
Please let me know if you need any further assistance on the matter.
I have logged this behavior with our developers in our tracking system, with an issue ID of 110761. I have also created a support ticket on your behalf with number CAS-89721-H73561 in order to link the development issue to it so that you are automatically updated when a Service Release containing your fix is available for download.