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
1425
XamDataGrid 13.1, selecting first record
posted

In my app, I have a main XamDataGrid, which contains records, and these records contains several child objects. I am not using the heirarchial panels in the grid due to user requirements...the child grids are elsewhere on the form.

When I load the form, I programitically select the first record in the parent grid, and populate the child grids with child records.

When I click into the first cell of a new row, the child objects are cleared, of course.

This all works fine, except when I click in the first cell on the new record on the parent grid (xamDataGridPumpingStages), then begin typing, only 1 character is accepted before the grid accepts the row (I quess), and the newly added row is no longer active/focused. I have to click into the first cell to finish editing.

I am using this code:

private void xamdDataPumpingStages_RecordAdded(object sender,  Infragistics.Windows.DataPresenter.Events.RecordAddedEventArgs e)

{

Record r = e.Record();

DataRecord dr = (DataRecord)r;

viewModel.CurrentProject.CurrentPumpingStage = (UTEFPumpingStage)d.DataItem;

}

private void xamDataGridPUmpingStages_InitializeRecord(object sender,  Infragistics.Windows.DataPresenter.Events.InitializeRecordEventArgs e)

{

xamDataGridPumpingStages.Records[0].IsActive = true;

xamDataGridPumpingStages.Records[0].IsSelected = true;

xamDataGridPUmpingStages.ActiveRecord = xamDataGridPumpingStages.Records[0];

}

private void xamDataGridPumpingStages_RecordsActivated(object sender,  Infragistics.Windows.DataPresenter.Events.RecordActivatedChangedEventArgs e)

{

if (((XamDataGrid)sender).ActiveRecord == null)

{

return;

}

Record r = ((XamDataGrid)sender).ActiveRecord;

DataRecord dr = (DataRecord)r;

viewModel.CurrentProject.CurrentUTEFPumpingStage = (UTEFPumpingStage)dr.DataItem;

if (viewModel.CurrentProject.CurrentUTEFPumpingStage != null)

{

viewModel.GUI_Builder_Pane_Tab_Reservoir_Expander.FluidAndProppant_Title = viewModel.CurrentProject.CurrentUTEFPumpingStage.StageName;

GenerateMassFractionsGrid();

}

}

Parents
No Data
Reply
  • 1425
    Verified Answer
    posted

    Disregard this question. I resolved the issue.

    I moved the three lines of code in the InitializeRecord function to where I open the data file, so this code is run once the objects are populated.

Children
No Data