Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
CODE PROJECT For Those Who Code
  • Home
  • Articles
  • FAQ
Community
B

bindum31

@bindum31
About
Posts
5
Topics
3
Shares
0
Groups
0
Followers
0
Following
0

Posts

Recent Best Controversial

  • WPF cascaded combo
    B bindum31

    I am not clear. Would you please send me a sample code.

    WPF wpf csharp database css wcf

  • WPF cascaded combo
    B bindum31

    Thanks Castle Rider for your reply. I have made a Generic "BasePresenter" class where i have implemented INotifyPropertyChanged interface in the following way:

    public event PropertyChangedEventHandler PropertyChanged;

    protected void OnPropertyChanged(string propertyName)
    {
    PropertyChangedEventHandler handler = this.PropertyChanged;
    if (handler != null)
    {
    handler(this, new PropertyChangedEventArgs(propertyName));
    }
    }

    And in my Presenter class I have used:

        public ObservableCollection<INVCategory> CategoryList
        {
            get
            {
                return this.categoryList;
            }
    
            set
            {
                this.categoryList = value;
                **OnPropertyChanged**("CategoryList");
                
            }
        }
    
    WPF wpf csharp database css wcf

  • WPF cascaded combo
    B bindum31

    Hi, I am using LINQ to SQL and MVVM pattern in my application where i am retrieving my data by the following query:

    internal ObservableCollection GetCategoryList()
    {
    DataLoadOptions dataLoadOptions = new DataLoadOptions();
    dataLoadOptions.LoadWith(t => t.INVSubCategories);
    this.Context.LoadOptions = dataLoadOptions;

     var categories = from category in this.Context.INVCategories
                      orderby category.CatgeoryId descending
                      select category;
     return new ObservableCollection(categories.ToList());
    

    }

    And my XAML code for parent(Category) combo is:

    <ComboBox Grid.Column="1" Grid.Row="0" HorizontalAlignment="Stretch" VerticalAlignment="Stretch" Margin="0,2,10,2" TabIndex="0" x:Name="categoryComboBox"
    ItemsSource="{Binding CategoryList}" IsEditable="True" DisplayMemberPath="CategoryName" SelectedValuePath="CatgeoryId" SelectedItem="{Binding CategoryList, Mode=TwoWay}" SelectedValue="{Binding Path=CurrentEntity.CategoryId, Mode=TwoWay}" >
    </ComboBox>

    for child(Subcategory) combo i am using:

    <ComboBox Grid.Column="1" Grid.Row="1" HorizontalAlignment="Stretch" VerticalAlignment="Stretch" Margin="0,2,10,2" TabIndex="1"
    ItemsSource="{Binding SelectedItem, ElementName=categoryComboBox, Mode=OneWay}"
    DisplayMemberPath="SubCategoryName" SelectedValuePath="SubCategoryId"
    SelectedItem="{Binding INVSubCategories, Mode=TwoWay}">
    </ComboBox>

    But my child combo items is not populated during form loading as well as parent combo's selection changed though my parent combo items are populated. i can't figure out why my child combo is not functioning based on parent combo's selected item ,please help me.

    WPF wpf csharp database css wcf

  • WPF cascaded combo
    B bindum31

    Hi, I am using LINQ to SQL and MVVM pattern in my application where i am retrieving my data by the following query:

    internal ObservableCollection<INVCategory> GetCategoryList()
    {
    DataLoadOptions dataLoadOptions = new DataLoadOptions();
    dataLoadOptions.LoadWith<INVCategory>(t => t.INVSubCategories);
    this.Context.LoadOptions = dataLoadOptions;

      var categories = from category in this.Context.INVCategories
                       orderby category.CatgeoryId descending
                       select category;
      return new   ObservableCollection&lt;INVCategory&gt;(categories.ToList());
    

    }

    And my XAML code for parent(Category) combo is:

    <ComboBox Grid.Column="1" Grid.Row="0" HorizontalAlignment="Stretch" VerticalAlignment="Stretch" Margin="0,2,10,2" TabIndex="0" x:Name="categoryComboBox" ItemsSource="{Binding CategoryList}" IsEditable="True" DisplayMemberPath="CategoryName" SelectedValuePath="CatgeoryId" SelectedItem="{Binding CategoryList, Mode=TwoWay}" SelectedValue="{Binding Path=CurrentEntity.CategoryId, Mode=TwoWay}">
    </ComboBox>

    for child(Subcategory) combo i am using:

    <ComboBox Grid.Column="1" Grid.Row="1" HorizontalAlignment="Stretch" VerticalAlignment="Stretch" Margin="0,2,10,2" TabIndex="1" ItemsSource="{Binding SelectedItem, ElementName=categoryComboBox, Mode=OneWay}" DisplayMemberPath="SubCategoryName" SelectedValuePath="SubCategoryId" SelectedItem="{Binding INVSubCategories, Mode=TwoWay}" >
    </ComboBox>

    But my child combo items is not populated during form loading as well as parent combo's selection changed though my parent combo items are populated. i can't figure out why my child combo is not functioning based on parent combo's selected item ,please help me.

    Database wpf csharp database css wcf

  • WCF data transfer
    B bindum31

    Dear all, When i use Dataset to retrieve data from WCF service to client according to the following process it works perfectly:

    public DataSet GetJobs()
    {
    SqlConnection cn = new SqlConnection(@"Data Source=dotnet02\SQLEXPRESS;Initial Catalog=pubs;Integrated Security=True");
    DataSet ds = new DataSet();
    SqlDataAdapter da = new SqlDataAdapter("Select * from jobs", cn);
    da.Fill(ds, "jobs");
    return ds;
    }

    But when i want to return LIST<Job>instead of Dataset in the follwing way i can't access the method from Client side though after modification of my service code i take the reference of my service from the client as before.

    public List<Job> GetJobs()
    {
    SqlConnection cn = new SqlConnection(@"Data Source=dotnet02\SQLEXPRESS;Initial Catalog=pubs;Integrated Security=True");
    string sqlstat = "select * from jobs";
    SqlCommand cmd = new SqlCommand(sqlstat, cn);
    SqlDataReader dr = cmd.ExecuteReader();
    List<Job> allJobs = new List<Job>();
    Job jobObj;
    while (dr.Read())
    {
    jobObj = new Job();
    jobObj.Description = dr["job_desc"].ToString();
    jobObj.MinLevel = Convert.ToInt32(dr["min_lvl"]);
    jobObj.MaxLevel = Convert.ToInt32(dr["max_lvl"]);
    allJobs.Add(jobObj);
    }
    return allJobs;
    }

    I can't figure out the problem! How can i do this? Any help will be highly appreciated.

    WCF and WF help question csharp wcf security
  • Login

  • Don't have an account? Register

  • Login or register to search.
  • First post
    Last post
0
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups