Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6986349
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 27, 20262026-05-27T18:47:51+00:00 2026-05-27T18:47:51+00:00

I have one form open and then I go to the table and update

  • 0

I have one form open and then I go to the table and update one record. Then I return back and refresh the form, but that record is not updated.

I have a DataGrid in the form, which is bound to an ObservableCollection. On refresh, I add records from the database to this ObservableCollection using:

filteredProductList.Clear();
foreach(Formulation frm in dbContext.Formulations)
{
    filterViewedList.Add(frm);
}

The PageLoad event is below:

private void loadData()
{
    try
    {
        filterViewedList= new ObservableCollection<Formulation>(dbContext.Formulations);
        dgRecords1.ItemsSource = filterViewedList;
    }

The XAML is below:

<DataGrid Height="387"  x:Name="dgRecords1" Margin="0,0,64,0"  
    IsSynchronizedWithCurrentItem="True"  Style="{DynamicResource StyleDatagrid}"
    ClipboardCopyMode="None" ColumnHeaderStyle="{DynamicResource DataGridColumnHeaderStyle1}"                 
    SelectionChanged="dgRecords1_SelectionChanged" Grid.Column="1" Grid.Row="3">

    <DataGrid.Resources>
        <SolidColorBrush x:Key="{x:Static SystemColors.HighlightBrushKey}" Color="LightBlue"/>
    </DataGrid.Resources>

    <DataGrid.Columns>
        <DataGridTextColumn Width="110" Header="Code" Binding="{Binding FrmltnNo, Mode=TwoWay}" IsReadOnly="True" Foreground="Black"/>
        <DataGridTextColumn Width="415" Header="Description" Binding="{Binding FrmltnName, Mode=TwoWay}" IsReadOnly="True" Foreground="Black"/>

        <DataGridTextColumn Width="*" Header="Status" Binding="{Binding Status, Mode=TwoWay}" IsReadOnly="True" >
            <DataGridTextColumn.CellStyle>
                <Style TargetType="{x:Type DataGridCell}">
                    <Setter Property="Foreground" Value="{Binding Converter={StaticResource FGColorKey}}"/>
                </Style>

            </DataGridTextColumn.CellStyle>
        </DataGridTextColumn>

    </DataGrid.Columns>
</DataGrid>
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-27T18:47:52+00:00Added an answer on May 27, 2026 at 6:47 pm

    Show the code you call “refresh”. dgRecords1.ItemsSource = filterViewedList is just going to be a static copy. I suspect the UI is not aware of the update. Expose filteredProductList as a public ObservableCollection FilteredProductList and bind to FilteredProductList and then the UI will be aware of the update via the magic of ObservableCollection. And it would be cleaner to update only the one rather than repopulate the whole list.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have one form in a PHP (5.2.9-1) application that causes IIS (Microsoft-IIS/6.0) to
I need to make the program which have one form that contains PNG image
I have one page (Products) that searches for products which are then displayed in
This question has been asked here in one form or another but not quite
I have one form with several text fields and one button. When i enter
i have one form which have some input box and some select box. i
so here's the problem I have one form, it outputs search results after submit,
IDE: Microsoft Visual Studio Professional 2008 Language: C# Background: I have one form and
I'm working on a C# program, and right now I have one Form and
I have WPF Application where I have One main form and other user controls

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.