I have a couple issues regard a xamdatagrid the xaml looks like this:
<Grid> <igDock:XamDockManager Name="xamDockManager"> <igDock:XamDockManager.Panes> <igDock:SplitPane SplitterOrientation="Horizontal" igDock:XamDockManager.InitialLocation="DockedTop" MinHeight="170"> <igDock:SplitPane SplitterOrientation="Vertical"> <igDock:ContentPane Header="Data Entry" HorizontalAlignment="Stretch" igDock:SplitPane.RelativeSize="4,1" MinWidth="712"> <StackPanel Height="Auto" Name="spDataEntry" Width="Auto"> <StackPanel Height="Auto" Name="spHeader" Width="Auto" MinHeight="75" VerticalAlignment="Stretch"> <igDP:XamDataGrid Name="grid1" ClipToBounds="True" SnapsToDevicePixels="False"></igDP:XamDataGrid> </StackPanel> <StackPanel Height="Auto" Name="spDetail" Width="Auto" MinHeight="75" VerticalAlignment="Stretch"> <igDP:XamDataGrid Name="grid2" ClipToBounds="True" SnapsToDevicePixels="False"></igDP:XamDataGrid> </StackPanel> </StackPanel> </igDock:ContentPane> <!--Vendor Info--> <igDock:ContentPane Header="Vendor Info" HorizontalAlignment="Stretch" igDock:SplitPane.RelativeSize="1,4"> <StackPanel Height="Auto" Name="spVendorInfo" Width="Auto" > <StackPanel Name="spInfoBox" Width="Auto" MinHeight="60" > <TextBox Name="txtVendorInfo" Width="Auto" Height="Auto" MinHeight="60" TextWrapping="Wrap" AcceptsReturn="True" AcceptsTab="True" HorizontalScrollBarVisibility="Auto" IsReadOnly="True" VerticalScrollBarVisibility="Auto" /> </StackPanel> <StackPanel Name="spRecvTicket" Width="Auto" MinHeight="20" > <CheckBox Name="chkReceivingTicket" Width="Auto" Height="16" Content="Receiving Ticket Attached" VerticalContentAlignment="Center" /> </StackPanel> <StackPanel Name="spInfoGrid" Width="Auto" Height="Auto" > <igDP:XamDataGrid x:Name="grdInfo" Width="Auto" Height="Auto" MinHeight="70"> <igDP:XamDataGrid.FieldLayoutSettings> <igDP:FieldLayoutSettings AutoGenerateFields="True" /> </igDP:XamDataGrid.FieldLayoutSettings> </igDP:XamDataGrid> </StackPanel> </StackPanel> </igDock:ContentPane> </igDock:SplitPane> </igDock:SplitPane> </igDock:XamDockManager.Panes> </igDock:XamDockManager> </Grid>
The grid is bound to a DataRowCollection in code. Here is the code
public Window1() { InitializeComponent(); } private void Window_Loaded( object sender , RoutedEventArgs e ) { this.grid1.FieldLayoutSettings.AutoGenerateFields = true; this.grid1.FieldLayoutSettings.AllowAddNew = true; this.grid1.FieldLayoutSettings.AddNewRecordLocation = Infragistics.Windows.DataPresenter.AddNewRecordLocation.OnBottom; this.grid1.FieldLayoutSettings.AllowFieldMoving = Infragistics.Windows.DataPresenter.AllowFieldMoving.No; this.grid1.FieldLayoutSettings.AutoArrangeCells = Infragistics.Windows.DataPresenter.AutoArrangeCells.LeftToRight; this.grid1.FieldSettings.AllowFixing = Infragistics.Windows.DataPresenter.AllowFieldFixing.No; this.grid1.FieldSettings.AllowGroupBy = false; this.grid1.FieldSettings.AllowSummaries = false; this.grid1.FieldSettings.AllowHiding = AllowFieldHiding.ViaFieldChooserOnly; DataTable invoices = new DataTable(); invoices.Columns.Add("invoiceId"); invoices.Columns.Add("vendor"); invoices.Columns.Add("date"); invoices.Columns["date"].DataType = typeof(DateTime); invoices.Rows.Add(new object[] { 1 , "abc123" , DateTime.Now }); invoices.Rows.Add(new object[] { 2 , "blah blah" , DateTime.Now }); this.grid1.DataSource = invoices.Rows; Style s = new Style(typeof(Infragistics.Windows.Editors.XamDateTimeEditor)); Setter set = new Setter(Infragistics.Windows.Editors.XamDateTimeEditor.FormatProperty , "MM-dd-yyyy"); s.Setters.Add(set); set = new Setter(Infragistics.Windows.Editors.XamDateTimeEditor.MaskProperty , "mm-dd-yyyy"); s.Setters.Add(set); this.grid1.FieldLayouts[0].Fields["date"].Settings.EditorStyle = s; s = new Style(typeof(Infragistics.Windows.Editors.XamMaskedEditor)); set = new Setter(Infragistics.Windows.Editors.XamMaskedEditor.MaskProperty , string.Format("{0}" , "".PadLeft(12 , '&'))); s.Setters.Add(set); this.grid1.FieldLayouts[0].Fields["vendor"].Settings.EditorStyle = s; this.grid1.EditModeEnding += new EventHandler<Infragistics.Windows.DataPresenter.Events.EditModeEndingEventArgs>(grid1_EditModeEnding); } void grid1_EditModeEnding( object sender , Infragistics.Windows.DataPresenter.Events.EditModeEndingEventArgs e ) { }
The problem occurs when im editing a cell and then i leave that cell by clicking one of the other dock panels. When I try to re-enter the cell that is in edit mode i cannot and the cell seems to be frozen in edit mode. I have to click on another cell and then reenter the original cell to get back into editing the original cell. Furthermore, in some cases the cell freezes in edit mode and i cannot get back into the cell or any other cell. In this case, I have to close and reload the form.
Any suggestions?
Hello,
It has been a while since you have made your post, in case you still need support I will be glad to assist you further. I suppose the other community members can benefit from this answer as well. I have been looking through your post and suggest you look through this forum thread:
http://forums.infragistics.com/forums/p/35805/229307.aspx
where a similar issue like yours is discussed.
Feel free to write me if you have further questions.
Stefan
I have similar problem,
When XamDataGrid is in XamDockManager’s contentPane in TabGroup, XamDataGrid freezes when trying to edit string value, when same code taken out from XamDockmanager and everything works perfect.
Please help me on this, I did even tried setting FocusManager.SetFocusedElement, as the other thread you have suggested in the above reply but Still I have its freezing when I tried to edit cell.
Another question, binding data when it has 25 columns to bind is slow, like to know how to improve and is there any event to subscribe to know DataLoad is complete.
Try to post Small code snippet in your reply.
Thanks
yogi