Your Privacy Matters: We use our own and third-party cookies to improve your experience on our website. By continuing to use the website we understand that you accept their use. Cookie Policy
190
Cell Freezes after losing Focus
posted

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?

Parents Reply Children