I have this XamGrid and I would like to know which action to implement get the choosen cells or records when left mouse buttom is relased.
<igWPF:XamDataGrid DataSource="{Binding Path=observale, Mode=OneWayToSource}" VerticalAlignment="Top" Name="dgAktiveAviser" SelectedDataItemsScope="RecordsOrCells" IsUndoEnabled="True" MouseUp="dgAktiveAviser_MouseUp"> <igWPF:XamDataGrid.FieldSettings > <igWPF:FieldSettings AllowCrossFieldRecordFiltering="true" AllowRecordFiltering="true" CellClickAction="SelectCell" /> </igWPF:XamDataGrid.FieldSettings>
<igWPF:XamDataGrid.FieldLayouts>
<igWPF:FieldLayout>
<igWPF:FieldLayout.CrossFieldRecordFilters> <igWPF:CrossFieldRecordFilterGroup LogicalOperator="And"> <igWPF:CrossFieldRecordFilterGroup LogicalOperator="Or"> <igWPF:CrossFieldRecordFilter FieldName="Navn" Operator="Equals" Operand="UK" /> <igWPF:CrossFieldRecordFilter FieldName="Adresse" Operator="Equals" Operand="USA" /> </igWPF:CrossFieldRecordFilterGroup> <igWPF:CrossFieldRecordFilter FieldName="ContactName" Operator="StartsWith" Operand="A" /> </igWPF:CrossFieldRecordFilterGroup> </igWPF:FieldLayout.CrossFieldRecordFilters> <igWPF:TextField Name="BladID" Label="Blad ID2" Visibility="Hidden">
</igWPF:TextField>
<igWPF:TextField Name="Navn" Label="Navn" Visibility="Visible"></igWPF:TextField> <igWPF:TextField Name="Adresse" Label="Adresse" Visibility="Visible"></igWPF:TextField> <igWPF:TextField Name="PostNr" Label="Post Nummer" Visibility="Visible"></igWPF:TextField> <igWPF:TextField Name="PostBy" Label="Post By" Visibility="Visible"></igWPF:TextField> <igWPF:TextField Name="Tlf" Visibility="Visible"></igWPF:TextField> <igWPF:TextField Name="CVR" Label="CVR" Visibility="Hidden"></igWPF:TextField> <igWPF:TextField Name="Kontaktperson" Label="Kontakt Person" Visibility="Hidden"></igWPF:TextField> <igWPF:TextField Name="HovedGruppeNavn" Label="Hoved Gruppe" Visibility="Visible"></igWPF:TextField> <igWPF:TextField Name="MedlemMåned" Label="Medlem Måned"></igWPF:TextField> <igWPF:TextField Name="MedlemÅr" Label="Medlem År"></igWPF:TextField> <igWPF:TextField Name="Ejerforhold" Label="Ejerforhold" Visibility="Visible"></igWPF:TextField> <igWPF:TextField Name="RegionNavn" Label="Region Navn" Visibility="Visible"></igWPF:TextField> <igWPF:TextField Name="DelOmrådeNavn" Label="Delområde" Visibility="Visible"></igWPF:TextField> <igWPF:TextField Name="DIMPDelOmrådeKode" Label="DIMPDelOmrådeKode" Visibility="Hidden"></igWPF:TextField> <igWPF:TextField Name="GeoKodeNavn" Label="Geo kode navn" Visibility="Visible"></igWPF:TextField> <igWPF:TextField Name="Totalområde" Label="Total område" Visibility="Visible"></igWPF:TextField> <igWPF:TextField Name="TotalområdePct" Label="Total område %" Visibility="Visible"></igWPF:TextField> <igWPF:TextField Name="Primær" Label="Primær" Visibility="Visible"></igWPF:TextField> <igWPF:TextField Name="PrimærPct" Label="Primær %" Visibility="Visible"></igWPF:TextField> <igWPF:TextField Name="WWWDækninSomTekst" Label="WWW Dækning som tekst" Visibility="Hidden"></igWPF:TextField> <igWPF:TextField Name="Oplag" Label="Oplag" Visibility="Visible"></igWPF:TextField> <igWPF:TextField Name="Udgivelsesdag" Label="Udgivelses dag" Visibility="Visible"></igWPF:TextField> <igWPF:TextField Name="Format" Label="Format" Visibility="Visible"></igWPF:TextField> <igWPF:TextField Name="OrdredeadlineTekst" Label="Ordredeadline" Visibility="Visible"></igWPF:TextField> <igWPF:CheckBoxField Name="OrdredeadlineRubrik" Label="OrdreDeadline"></igWPF:CheckBoxField> <igWPF:TextField Name="MaterialedeadlineTekst" Label="Materiale deadline"></igWPF:TextField> <igWPF:CheckBoxField Name="MaterialedeadlineRubrik" Label="Materiale deadline"></igWPF:CheckBoxField> <igWPF:TextField Name="OrdreEmail" Label="Ordre Email" Visibility="Hidden"></igWPF:TextField> <igWPF:TextField Name="OrdrecheckEmail" Label="Ordre Check Email"></igWPF:TextField> <igWPF:TextField Name="DagNavn" Label="Dag Navn"></igWPF:TextField> <igWPF:CheckBoxField Name="SendetidOrdrecheck" Label="Sennde tid"></igWPF:CheckBoxField> <igWPF:TextField Name="SendIndeværendeUge" Label="Send IndeværendeUge"></igWPF:TextField> <igWPF:TextField Name="StamdataEmail" Label="StamdataEmail"></igWPF:TextField> <igWPF:TextField Name="PrisforespørgselEmails" Label="PrisforespørgselEmails"></igWPF:TextField> <igWPF:TextField Name="OrienteringEmails" Label="OrienteringEmails"></igWPF:TextField> <igWPF:TextField Name="Emails" Label="Emails"></igWPF:TextField> <igWPF:TextField Name="KontaktpersonerEmails" Label="KontaktpersonerEmails" Visibility="Hidden"></igWPF:TextField> <igWPF:TextField Name="BogholderiEmails" Label="BogholderiEmails" Visibility="Hidden"></igWPF:TextField> <igWPF:TextField Name="MedieNetKode" Label="MedieNetKode" Visibility="Hidden"></igWPF:TextField> <igWPF:TextField Name="Hjemmeside" Label="Hjemmeside" Visibility="Hidden"></igWPF:TextField> <igWPF:TextField Name="RedaktionEmail" Label="RedaktionEmail" Visibility="Hidden"></igWPF:TextField> <igWPF:TextField Name="AnnonceEmail" Label="AnnonceEmail" Visibility="Hidden"></igWPF:TextField> <igWPF:TextField Name="MaterialeEmail" Label="MaterialeEmail" Visibility="Hidden"></igWPF:TextField> <igWPF:TextField Name="AnnonceKontrolEmail" Label="AnnonceKontrolEmail" Visibility="Hidden"></igWPF:TextField> <igWPF:TextField Name="BilagsbladeEmail" Label="BilagsbladeEmail" Visibility="Hidden"></igWPF:TextField> <igWPF:TextField Name="GruppeNavn" Label="GruppeNavn" Visibility="Hidden"></igWPF:TextField> <igWPF:TextField Name="GruppeRabat" Label="GruppeRabat" Visibility="Hidden"></igWPF:TextField> <igWPF:TextField Name="SamannonceringsRabat" Label="SamannonceringsRabat" Visibility="Hidden"></igWPF:TextField> <igWPF:TextField Name="HovedgruppeID" Label="HovedgruppeID" Visibility="Hidden"></igWPF:TextField> <igWPF:TextField Name="Ophørt" Label="Ophørt" Visibility="Hidden"></igWPF:TextField> <igWPF:TextField Name="Version" Label="Version" Visibility="Hidden"></igWPF:TextField>
</igWPF:FieldLayout>
</igWPF:XamDataGrid.FieldLayouts>
<igWPF:XamDataGrid.FieldLayoutSettings> <igWPF:FieldLayoutSettings HeaderPrefixAreaDisplayMode="Menu" HeaderPrefixAreaMenuOptions="Default" FilterUIType="Default"/> </igWPF:XamDataGrid.FieldLayoutSettings> </igWPF:XamDataGrid>
private void Grid_PreviewMouseLeftButtonUp(object sender, MouseButtonEventArgs e) { var selectedItems = (sender as XamDataGrid).SelectedItems; if(selectedItems.Cells.Count != 0) { //get selected cells from selectedItems.Cells } else if(selectedItems.Records.Count != 0) { //get selected records from selectedItems.Records } }
Thanks it works fine
Hello Thomas,
I am glad that you find my suggestion helpful.
Thank you for using Infragistics components.
Regards,Teodosia HristodorovaAssociate Software Developer