Your Privacy Matters: We use our own and third-party cookies to improve your experience on our website. By continuing to use the website we understand that you accept their use. Cookie Policy
1104
Bind EventLog to DataSource of WinGrid
posted

Hi,

i just tried to bind the Windows security event log to a WinGrid using this code:

ultraGrid1.DataSource = eventLog.Entries;
            //ultraGrid1.DataMember = "Microsoft-Windows-Security-Auditing";

When debugging, eventLog.Entries contains about 100 entries, but they don't appear in the grid. I tried several methods like Update(), UpdateData(), BindData(), with no success.

The column names of the eventLog.Entries collection are shown correctly.

What could be the problem?

Thanks and best regards

Parents
No Data
Reply
  • 469350
    Verified Answer
    Offline posted

    DataBinding in DotNet will work with any class that implements IList or IBindingList and the EventLogEntryCollection does not implement either of these interfaces, it's an ICollection.

    You could copy the data from the Entries collection into a BindingList<EventLogEntry> and bind that to the grid.

Children
No Data