Click here to Skip to main content
15,883,901 members
Home / Discussions / C#
   

C#

 
AnswerRe: Please give me some explaination about the following Microsoft.ToolKit.MVVM Pin
OriginalGriff23-Jul-22 9:18
mveOriginalGriff23-Jul-22 9:18 
QuestionClient and Server side validations for Calendar control Pin
Member 995054522-Jul-22 4:20
Member 995054522-Jul-22 4:20 
AnswerRe: Client and Server side validations for Calendar control Pin
Gerry Schmitz22-Jul-22 5:18
mveGerry Schmitz22-Jul-22 5:18 
QuestionI still didnt figure out how to upate a DGV without pressing enter Pin
grennday21-Jul-22 19:22
grennday21-Jul-22 19:22 
AnswerRe: I still didnt figure out how to upate a DGV without pressing enter Pin
Richard MacCutchan22-Jul-22 1:05
mveRichard MacCutchan22-Jul-22 1:05 
GeneralRe: I still didnt figure out how to upate a DGV without pressing enter Pin
grennday26-Jul-22 2:15
grennday26-Jul-22 2:15 
GeneralRe: I still didnt figure out how to upate a DGV without pressing enter Pin
Richard MacCutchan26-Jul-22 2:25
mveRichard MacCutchan26-Jul-22 2:25 
QuestionPutting event handler codes inside DoWork delegate for asynchronous multi-threaded calculations Pin
Code4Ever15-Jul-22 18:35
Code4Ever15-Jul-22 18:35 
I have the following code for getting data and paginating them inside the DataGrid:

private void dataPager_OnDemandLoading(object sender, Syncfusion.UI.Xaml.Controls.DataPager.OnDemandLoadingEventArgs args)
{
    List<Equipment> data;
    using (var _sqliteContext = new SQLiteContext())
    {
        data = _sqliteContext.Equipments.Include(x => x.CostCenter).Skip(args.StartIndex).Take(args.PageSize).ToList();
    }
    dataPager.LoadDynamicItems(args.StartIndex, data);
    //resetting cache for all pages.
    (dataPager.PagedSource as PagedCollectionView).ResetCache();
}


Now, I want to use background worker to do calculation in an another thread. I make the following changes:

private void dataPager_OnDemandLoading(object sender, Syncfusion.UI.Xaml.Controls.DataPager.OnDemandLoadingEventArgs args)
        {
            BackgroundWorker worker = new BackgroundWorker();
            worker.WorkerReportsProgress = false;

            worker.DoWork += worker_DoWork;
            worker.RunWorkerAsync();

        }


void worker_DoWork(object sender, DoWorkEventArgs e)
        {
            List<Equipment> data;
            using (var _sqliteContext = new SQLiteContext())
            {
                data = _sqliteContext.Equipments.Include(x => x.CostCenter).Skip(args.StartIndex).Take(args.PageSize).ToList();
            }
            dataPager.LoadDynamicItems(args.StartIndex, data);
            //resetting cache for all pages.
            (dataPager.PagedSource as PagedCollectionView).ResetCache();
        }

But, worker_DoWork does not have any overload. I cannot pass args to worker_DoWork
How can I solve it?
AnswerRe: Putting event handler codes inside DoWork delegate for asynchronous multi-threaded calculations Pin
OriginalGriff15-Jul-22 19:45
mveOriginalGriff15-Jul-22 19:45 
GeneralRe: Putting event handler codes inside DoWork delegate for asynchronous multi-threaded calculations Pin
Code4Ever15-Jul-22 19:50
Code4Ever15-Jul-22 19:50 
GeneralRe: Putting event handler codes inside DoWork delegate for asynchronous multi-threaded calculations Pin
OriginalGriff15-Jul-22 20:00
mveOriginalGriff15-Jul-22 20:00 
GeneralRe: Putting event handler codes inside DoWork delegate for asynchronous multi-threaded calculations Pin
Code4Ever15-Jul-22 19:52
Code4Ever15-Jul-22 19:52 
GeneralRe: Putting event handler codes inside DoWork delegate for asynchronous multi-threaded calculations Pin
OriginalGriff15-Jul-22 20:02
mveOriginalGriff15-Jul-22 20:02 
GeneralRe: Putting event handler codes inside DoWork delegate for asynchronous multi-threaded calculations Pin
Code4Ever15-Jul-22 20:04
Code4Ever15-Jul-22 20:04 
GeneralRe: Putting event handler codes inside DoWork delegate for asynchronous multi-threaded calculations Pin
Richard Andrew x6417-Jul-22 4:00
professionalRichard Andrew x6417-Jul-22 4:00 
AnswerRe: Putting event handler codes inside DoWork delegate for asynchronous multi-threaded calculations Pin
Gerry Schmitz16-Jul-22 5:13
mveGerry Schmitz16-Jul-22 5:13 
AnswerRe: Putting event handler codes inside DoWork delegate for asynchronous multi-threaded calculations Pin
Richard Deeming17-Jul-22 20:55
mveRichard Deeming17-Jul-22 20:55 
QuestionDisposing issue when trying to load data from SQLite database Pin
Code4Ever14-Jul-22 20:22
Code4Ever14-Jul-22 20:22 
AnswerRe: Disposing issue when trying to load data from SQLite database Pin
Richard MacCutchan14-Jul-22 21:18
mveRichard MacCutchan14-Jul-22 21:18 
GeneralRe: Disposing issue when trying to load data from SQLite database Pin
Code4Ever14-Jul-22 21:30
Code4Ever14-Jul-22 21:30 
QuestionCould not Load type spride Pin
Luis M. Rojas7-Jul-22 4:58
Luis M. Rojas7-Jul-22 4:58 
AnswerRe: Could not Load type spride Pin
Pete O'Hanlon7-Jul-22 21:39
mvePete O'Hanlon7-Jul-22 21:39 
QuestionRe: Could not Load type spride Pin
Richard MacCutchan7-Jul-22 23:29
mveRichard MacCutchan7-Jul-22 23:29 
QuestionJSDOC '@extends' is not attached to class Pin
Luis M. Rojas4-Jul-22 5:00
Luis M. Rojas4-Jul-22 5:00 
AnswerRe: JSDOC '@extends' is not attached to class Pin
Pete O'Hanlon4-Jul-22 5:04
mvePete O'Hanlon4-Jul-22 5:04 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.