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 7493551
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 29, 20262026-05-29T17:02:09+00:00 2026-05-29T17:02:09+00:00

I have an application that I have written to view logs from custom applications

  • 0

I have an application that I have written to view logs from custom applications that have been written for this company. I have it set up using an Entity Model and would like to dynamically change which database I am hitting (test database or production database) based on a menu selection. I have tried using an EntityConnectionStringBuilder and it appears to work with no errors, however I can not get the grid that displays the list of applications to update after changing the data connection string. (the connection strings for test and production servers are stored in the properties.settings) Here is what I have for switching to the test server

try
{
  XDocument doc = XDocument.Load(AppDomain.CurrentDomain.SetupInformation.ConfigurationFile);
  var query1 = from p in doc.Descendants("connectionStrings").Descendants()
             select p;
  foreach (var child in query1)
  {
    foreach (var atr in child.Attributes())
    {
        if (atr.Name.LocalName == "name" && atr.Value == "AppsEntities")
        if (atr.NextAttribute != null && atr.NextAttribute.Name == "connectionString")
        {
            EntityConnectionStringBuilder entityBuilder = new EntityConnectionStringBuilder(atr.NextAttribute.Value);
            entityBuilder.ProviderConnectionString = Properties.Settings.Default["TestServer"].ToString();
            atr.NextAttribute.Value = entityBuilder.ToString();
        }
    }
  }
  doc.Save(AppDomain.CurrentDomain.SetupInformation.ConfigurationFile);
  lblDatabase.Content = "Connected to the Test Server";
}
catch (Exception ex)
{
  MessageBox.Show("changing connection string to Test - blew up!" + ex.Message, "massive error", MessageBoxButton.OK, MessageBoxImage.Exclamation);
}

Any help would be appreciated I am new to C# and WPF’s so I may not be going about this the correct way.

 <telerik:RadGridView x:Name="LogApplicationGrid"
                         Width="900"
                         Height="Auto"
                         Margin="2,53,0,0"
                         HorizontalAlignment="Left"
                         VerticalAlignment="Top"
                         AutoGenerateColumns="false"
                         GridLinesVisibility="Horizontal"
                         IsReadOnly="true"
                         MouseDoubleClick="LogApplicationGrid_MouseDoubleClick"
                         ShowGroupPanel="False">
        <telerik:RadGridView.Columns>
            <telerik:GridViewDataColumn MaxWidth="50"
                                        DataMemberBinding="{Binding AppID}"
                                        Header="AppID"
                                        IsFilterable="False"
                                        UniqueName="appNumber" />
            <telerik:GridViewDataColumn MaxWidth="300"
                                        DataMemberBinding="{Binding AppName}"
                                        Header="Application Name" />
            <telerik:GridViewDataColumn MaxWidth="350"
                                        DataMemberBinding="{Binding AppDesc}"
                                        Header="Application Description" />
            <telerik:GridViewDataColumn MaxWidth="150"
                                        DataMemberBinding="{Binding DateCreated}"
                                        Header="Date Created"
                                        IsFilterable="False" />
            <telerik:GridViewCheckBoxColumn MaxWidth="100"
                                            DataMemberBinding="{Binding ShowInSharePoint}"
                                            Header="SharePoint"
                                            IsFilterable="False" />
        </telerik:RadGridView.Columns>
    </telerik:RadGridView>
  • 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-29T17:02:10+00:00Added an answer on May 29, 2026 at 5:02 pm

    Bind your GridView to an ObservableCollection<T>, then to update your Grid’s data, simply update the collection.

    Use an ObservableCollection<T> instead of a List<T> because it will automatically alert the UI that it needs to be updated when the collection changes.

    Also, be sure you’re binding the value instead of setting it. Setting the value will set the value to an instance of the data, not the actual data itself, so it won’t respond to changes.

    For example, this will not update the UI

    LogApplicationGrid = SomeCollection;
    SomeCollection = GetObservableCollection();
    

    But this will

    var b = new Binding();
    b.Source = SomeCollection;
    LogApplicationGrid.SetBinding(RadGridView.ItemsSourceProperty, b);
    
    SomeCollection = GetObservableCollection();
    

    and this also will

    <telerik:RadGridView ItemsSource="{Binding SomeCollection}" ... />
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a c# application that is using a custom DLL (written in C,
I have an existing application that is written in C++ for Windows. This application
I have written an AIR Application that downloads videos and documents from a server.
I'm using C# and i have written a locally installed application that dynamically generates
I have this application that I have written to calculate average. It comes up
I have written an application (using Delphi 2009) that allows a user to select
I have an application that is written in VB.NET, using the System.Windows.Forms.Form as the
I have written an application using opengl es view. Now I want to add
I have an application that was written in vanilla ASP.NET that I would like
I have an application that was originally written in Borland C++ and used a

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.