Click here to Skip to main content
15,900,906 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
How to call wcf as I select item from comboboxes.I have to display items in dataGrid according to all combobox selection.
My WCF is like bellow:
[OperationContract]
        public IEnumerable<eventdetail> GetEvents(EventQuery query)
        { 
            return new List<eventdetail>()
            {
                new EventDetail(){  Id=1, Description="Scan Complete:  Threats: 0   Scanned: 1274062   Files/Folders/Drives Omitted: 39",Type= EventType.Error, User="Local Account", Computer="INRG0081", CreationTime=DateTime.Now, EventId="10115", Source="SQL Server"},
                new EventDetail(){  Id=2, Description="Scan Complete:  Threats: 0   Scanned: 1274062   Files/Folders/Drives Omitted: 39",Type= EventType.Error, User="Local Account", Computer="INRG0081", CreationTime=DateTime.Now, EventId="10115", Source="SQL Server"},
               }
}
  public class EventQuery
    {
        public LogType logType { get; set; }
        public EventType Type { get; set; }
        public string Source { get; set; }
        public string EventId { get; set; }
        public DateTime CreationTimeStart { get; set; }
        public DateTime CreationTimeEnd { get; set; }
        public string User { get; set; }
        public string Computer { get; set; }
        public string Description { get; set; }
        public int MaxMatches { get; set; }

    }
 public class EventDetail
    {
        public int Id { get; set; }
        public EventType Type { get; set; }
        public DateTime CreationTime { get; set; }
        public string Source { get; set; }
        public string EventId { get; set; }
        public string User { get; set; }
        public string Computer { get; set; }
        public string Description { get; set; }

    }</eventdetail></eventdetail>


How to achieve that?
Posted
Updated 17-Jun-10 22:25pm
v2

Luck2 wrote:
How to call wcf as I select item from comboboxes.I have to display items in dataGrid according to all combobox selection.

Your question is not very clear.

However, from what I understand you can filter your datagrid based on what you select in the combo box. See here [^] for a sample.
 
Share this answer
 
combobox contain Selected Item property cast that one to your eventdetail object and and send to the WCF :)
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900