We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy.
Unfortunately, activation email could not send to your email. Please try again.

waitcursor

Thread ID:

Created:

Updated:

Platform:

Replies:

26987 Apr 4,2005 04:10 PM Apr 21,2005 10:16 AM Windows Forms 8
loading
Tags: Grouping
Faraz Haque
Asked On April 4, 2005 04:10 PM

Hi, I am trying to set the cursor to waitcursor when the grid loads from database. The code I use is this.Cursor = Cursors.WaitCursor; grid.DataSource = GetDataTable() this.Cursor = Cursors.Default I seem to get the default cursor even when the grid is still loading. Is there an event i can capture to know that the grid is done loading?? thanks

Administrator [Syncfusion]
Replied On April 4, 2005 05:30 PM

Faraz, the grid will only load the data on demand the first time records are accessed or the grid is painted. You can force initialization of the by accessing them. Then the grid is forced to load the data source right at that time. For example: this.Cursor = Cursors.WaitCursor; grid.DataSource = GetDataTable() int count = grid.Table.Records.Count; this.Cursor = Cursors.Default Stefan >Hi, > I am trying to set the cursor to waitcursor when the grid loads from database. The code I use is > >this.Cursor = Cursors.WaitCursor; >grid.DataSource = GetDataTable() >this.Cursor = Cursors.Default > >I seem to get the default cursor even when the grid is still loading. Is there an event i can capture to know that the grid is done loading?? > >thanks > >

Administrator [Syncfusion]
Replied On April 5, 2005 10:38 AM

Ok, but is there a way for me to be notified that the processing (dataloading/painting) is done? I load a pretty large dataset on to the grouping grid, and I need to show an hourglass in case user refreshes data /filters data , anything that takes more than a second or 2. The following code didnt help: int count = grid.Table.Records.Count; >Faraz, > >the grid will only load the data on demand the first time records are accessed or the grid is painted. > >You can force initialization of the by accessing them. Then the grid is forced to load the data source right at that time. > >For example: > >this.Cursor = Cursors.WaitCursor; >grid.DataSource = GetDataTable() >int count = grid.Table.Records.Count; >this.Cursor = Cursors.Default > >Stefan > > >>Hi, >> I am trying to set the cursor to waitcursor when the grid loads from database. The code I use is >> >>this.Cursor = Cursors.WaitCursor; >>grid.DataSource = GetDataTable() >>this.Cursor = Cursors.Default >> >>I seem to get the default cursor even when the grid is still loading. Is there an event i can capture to know that the grid is done loading?? >> >>thanks >> >>

Administrator [Syncfusion]
Replied On April 5, 2005 05:49 PM

Look for the following events: CategorizingRecords - Occurs before records are categorized after a table is marked dirty CategorizedRecords - Occurs after records were categorized InvalidatingCounters - Occurs when the of a is called and before all counters are marked dirty. SortingItemsInGroup - Occurs before the records for a group are sorted. SortedItemsInGroup - Occurs after the records for a group were sorted. In addition to that you can listen to PropertyChanging events. These are raised when the schema is changed (e.g. SortColumns, GroupedColumns etc). Example: this._gridGroupingControl1.PropertyChanging += new DescriptorPropertyChangedEventHandler(_gridGroupingControl1_PropertyChanging); this._gridGroupingControl1.TableControl.MouseUp += new MouseEventHandler(TableControl_MouseUp); bool displayWaitCursorOnMouseUp = false; private void TableControl_MouseUp(object sender, MouseEventArgs e) { if (this.displayWaitCursorOnMouseUp) Cursor.Current = Cursors.WaitCursor; displayWaitCursorOnMouseUp = false; } private void _gridGroupingControl1_PropertyChanging(object sender, DescriptorPropertyChangedEventArgs e) { if (t == null) { Cursor.Current = Cursors.WaitCursor; displayWaitCursorOnMouseUp = true; } } The MouseUp is a workaround because the TableControl.MouseControllerDispatcher resets the cursor back to default. Stefan

Administrator [Syncfusion]
Replied On April 18, 2005 11:25 AM

This is great. Now I can provide visual feedbacks when grid changes. One issue I still have. I load around 3000 rows on to the grouping grid each with around 20 cols. This takes time, which is expected. Is there a way to capture events before and after the loading of data starts too! Looks like the events you listed below occur only after the data is loaded onto the grid.. thanks >Look for the following events: > >CategorizingRecords - Occurs before records are categorized after a table is marked dirty > >CategorizedRecords - Occurs after records were categorized > >InvalidatingCounters - Occurs when the of a is called and before all counters are marked dirty. > >SortingItemsInGroup - Occurs before the records for a group are sorted. > >SortedItemsInGroup - Occurs after the records for a group were sorted. > >In addition to that you can listen to PropertyChanging events. These are raised when the schema is changed (e.g. SortColumns, GroupedColumns etc). > >Example: > > > this._gridGroupingControl1.PropertyChanging += new DescriptorPropertyChangedEventHandler(_gridGroupingControl1_PropertyChanging); > this._gridGroupingControl1.TableControl.MouseUp += new MouseEventHandler(TableControl_MouseUp); > > > bool displayWaitCursorOnMouseUp = false; > > > private void TableControl_MouseUp(object sender, MouseEventArgs e) > { > if (this.displayWaitCursorOnMouseUp) > Cursor.Current = Cursors.WaitCursor; > displayWaitCursorOnMouseUp = false; > } > > private void _gridGroupingControl1_PropertyChanging(object sender, DescriptorPropertyChangedEventArgs e) > { > if (t == null) > { > Cursor.Current = Cursors.WaitCursor; > displayWaitCursorOnMouseUp = true; > } >} > > > >The MouseUp is a workaround because the TableControl.MouseControllerDispatcher resets the cursor back to default. > >Stefan >

Administrator [Syncfusion]
Replied On April 18, 2005 12:27 PM

IN the example you provided below, whats "t" (in t == null) private void _gridGroupingControl1_PropertyChanging(object sender, DescriptorPropertyChangedEventArgs e) >> { >> if (t == null) >> { >> Cursor.Current = Cursors.WaitCursor; >> displayWaitCursorOnMouseUp = true; >> } >This is great. Now I can provide visual feedbacks when grid changes. One issue I still have. I load around 3000 rows on to the grouping grid each with around 20 cols. This takes time, which is expected. Is there a way to capture events before and after the loading of data starts too! Looks like the events you listed below occur only after the data is loaded onto the grid.. > >thanks > >>Look for the following events: >> >>CategorizingRecords - Occurs before records are categorized after a table is marked dirty >> >>CategorizedRecords - Occurs after records were categorized >> >>InvalidatingCounters - Occurs when the of a is called and before all counters are marked dirty. >> >>SortingItemsInGroup - Occurs before the records for a group are sorted. >> >>SortedItemsInGroup - Occurs after the records for a group were sorted. >> >>In addition to that you can listen to PropertyChanging events. These are raised when the schema is changed (e.g. SortColumns, GroupedColumns etc). >> >>Example: >> >> >> this._gridGroupingControl1.PropertyChanging += new DescriptorPropertyChangedEventHandler(_gridGroupingControl1_PropertyChanging); >> this._gridGroupingControl1.TableControl.MouseUp += new MouseEventHandler(TableControl_MouseUp); >> >> >> bool displayWaitCursorOnMouseUp = false; >> >> >> private void TableControl_MouseUp(object sender, MouseEventArgs e) >> { >> if (this.displayWaitCursorOnMouseUp) >> Cursor.Current = Cursors.WaitCursor; >> displayWaitCursorOnMouseUp = false; >> } >> >> private void _gridGroupingControl1_PropertyChanging(object sender, DescriptorPropertyChangedEventArgs e) >> { >> if (t == null) >> { >> Cursor.Current = Cursors.WaitCursor; >> displayWaitCursorOnMouseUp = true; >> } >>} >> >> >> >>The MouseUp is a workaround because the TableControl.MouseControllerDispatcher resets the cursor back to default. >> >>Stefan >>

Administrator [Syncfusion]
Replied On April 18, 2005 03:47 PM

Please ignore that line (if t == null). It is a left-over line from experimenting with timers. t was a Timer variable. But it is not needed. Setting the cursor in PropertyChanging code should take care of your issue with loading 3000 records. The wait cursor should be displayed before that. Stefan

Faraz Haque
Replied On April 19, 2005 10:41 AM

For some reason, i seem to loose the wait cursor after first few seconds of loading data. Not just that, the window kindof freezes and parts of other applications running in the background seems to appear on parts of the screen. (screenshot attached) . Till now, all my attempts to show a consistent hourglass on form load has failed. error1_9318.zip >Please ignore that line (if t == null). > >It is a left-over line from experimenting with timers. t was a Timer variable. But it is not needed. > >Setting the cursor in PropertyChanging code should take care of your issue with loading 3000 records. The wait cursor should be displayed before that. > >Stefan >

Administrator [Syncfusion]
Replied On April 21, 2005 10:16 AM

Hi Faraz, I think it''s best if we provide support for display of wait cursor within our codebase and you can turn it on/off as an option. That leaves less room for error. I let you know once we have implemented that. We should be able to get this out of the door together with VirtualMode support I promised earlier. Stefan >For some reason, i seem to loose the wait cursor after first few seconds of loading data. Not just that, the window kindof freezes and parts of other applications running in the background seems to appear on parts of the screen. (screenshot attached) . Till now, all my attempts to show a consistent hourglass on form load has failed. > >error1_9318.zip > >>Please ignore that line (if t == null). >> >>It is a left-over line from experimenting with timers. t was a Timer variable. But it is not needed. >> >>Setting the cursor in PropertyChanging code should take care of your issue with loading 3000 records. The wait cursor should be displayed before that. >> >>Stefan >> > > > >

CONFIRMATION

This post will be permanently deleted. Are you sure you want to continue?

Sorry, An error occured while processing your request. Please try again later.

You are using an outdated version of Internet Explorer that may not display all features of this and other websites. Upgrade to Internet Explorer 8 or newer for a better experience.

;