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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 4, 20262026-06-04T02:12:55+00:00 2026-06-04T02:12:55+00:00

I have a class Seive, a ObservableCollection seiveData object. public Seive(String id) { SeiveIdSize

  • 0

I have a class “Seive”, a ObservableCollection seiveData object.

        public Seive(String id)
    {
        SeiveIdSize = id;
        Caret = 0.0;
        Percent = 0.0;
        Peices = 0;
        Weight = 0.0;
        Size = 0;
    }

    public String SeiveIdSize   {    get;   set;   }
    public Double Weight { get; set; }
    public Double Percent   {    get;   set;   }
    public Double Caret {    get;   set;   }
    public uint Size    {    get;   set;   }
    public uint Peices  {    get;   set;   }

In my xml : I have

<DataGrid  Name="serverGrid" ItemsSource="{Binding}" .....>
<DataGrid.Columns>
<DataGridTextColumn Header="SEIVE" Width="Auto" Binding="{Binding Path=SeiveIdSize}" SortDirection="Ascending" />
 <DataGridTextColumn Header="CTS" Width="Auto" Binding="{Binding Path=Caret}" />
 <DataGridTextColumn Header=" % " Width="Auto" Binding="{Binding Path=Percent}" />
 <DataGridTextColumn Header="PCS" Width="Auto" Binding="{Binding Path=Peices}" />
 <DataGridTextColumn Header="WGT" Width="Auto" Binding="{Binding Path=Weight}" />
 <DataGridTextColumn Header="SIZE" Width="Auto" Binding="{Binding Path=Size}" />                                    
 </DataGrid.Columns>

In window Loaded event, I fill 2 seives in seiveData, yet I don’t see any results/rows.

seivesData.Add(new Seive("+10"));
seivesData.Add(new Seive("+8"));
seivesDataGrid.DataContext = seivesData;

EDIT :
Button Event Code :

        private void saveBtn_Click(object sender, RoutedEventArgs e)
    {
        Seive s1 = new Seive("+2");
        s1.Peices = 100;
        s1.Caret = 0.41;
        s1.Weight = 0.10;
        seivesData.Add(s1);
        Seive s = seivesData[0];
        s.Caret = 0.54;
        s.Weight = 0.32;
        seivesData[0] = s;
        seiveDG.DataContext = seivesData;
    }

Where am I going wrong ? I can see the newly added Seive all details, but Not the Caret & Weight added to 0th seive.

  • 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-06-04T02:12:58+00:00Added an answer on June 4, 2026 at 2:12 am

    The basic problem i see in your xaml is that you set the ItemsSource = {binding SeiveData}
    which is wrong if your pass this property into data context of the grid.

    This below code is working now. check it.

    one more thing if your want to notify the chagnes into the class Seive then must implement the INotifyPropertyChange interface.

    XAML

    <DataGrid Name="serverGrid" ItemsSource="{Binding}">
            <DataGrid.Columns>
                <DataGridTextColumn Width="Auto"
                                    Binding="{Binding Path=SeiveIdSize}"
                                    Header="SEIVE"
                                    SortDirection="Ascending" />
                <DataGridTextColumn Width="Auto"
                                    Binding="{Binding Path=Caret}"
                                    Header="CTS" />
                <DataGridTextColumn Width="Auto"
                                    Binding="{Binding Path=Percent}"
                                    Header=" % " />
                <DataGridTextColumn Width="Auto"
                                    Binding="{Binding Path=Peices}"
                                    Header="PCS" />
                <DataGridTextColumn Width="Auto"
                                    Binding="{Binding Path=Weight}"
                                    Header="WGT" />
                <DataGridTextColumn Width="Auto"
                                    Binding="{Binding Path=Size}"
                                    Header="SIZE" />
            </DataGrid.Columns>
        </DataGrid> 
    

    Cose behind

     ObservableCollection<Seive> _seiveData;
            public ObservableCollection<Seive> SeiveData
            {
                get { return _seiveData; }
                set { _seiveData = value; }
            }
            private void Window_Loaded(object sender, RoutedEventArgs e)
            {
    
                SeiveData = new ObservableCollection<Seive>();
                SeiveData.Add(new Seive("+10"));
                SeiveData.Add(new Seive("+8"));
    
                serverGrid.DataContext = SeiveData;
    
            }
    

    class

     public class Seive
        {
            public Seive(String id)
            {
                SeiveIdSize = id;
                Caret = 0.0;
                Percent = 0.0;
                Peices = 0;
                Weight = 0.0;
                Size = 0;
            }
    
            public String SeiveIdSize { get; set; }
            public Double Weight { get; set; }
            public Double Percent { get; set; }
            public Double Caret { get; set; }
            public uint Size { get; set; }
            public uint Peices { get; set; }
        }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a class Seive that implements INotifyPropertyChanged. I have a ObservableCollection SeiveList.I input
I have: class BASE{ public: virtual void func1() = 0; }; Then I have
i have this testing class <?php class IndexControllerTest extends ControllerTestCase { .... public function
public class Main { public static void main(String args []){ long numberOfPrimes = 0;
I have this working java code that serve as the datasource: public final class
Let's say that I have a bunch of class instances that serve different purposes,
I have class Question(db.Model): wording = db.StringProperty(required=True) class Answer(db.Model): question = db.ReferenceProperty(Question, required=True) userId
I have class to create user and return the info of user (success). class
I have class Building in which i have one class member NSMutableArray *subnode.I have
I have class Question < ActiveRecord::Base has_many :tasks, :as => :task end class QuestionPlayer

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.