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. Image for the cookie policy date

waitcursor

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

8 Replies

AD Administrator Syncfusion Team April 4, 2005 09:30 PM UTC

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 > >


AD Administrator Syncfusion Team April 5, 2005 02:38 PM UTC

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 >> >>


AD Administrator Syncfusion Team April 5, 2005 09:49 PM UTC

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


AD Administrator Syncfusion Team April 18, 2005 03:25 PM UTC

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 >


AD Administrator Syncfusion Team April 18, 2005 04:27 PM UTC

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 >>


AD Administrator Syncfusion Team April 18, 2005 07:47 PM UTC

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


FH Faraz Haque April 19, 2005 02:41 PM UTC

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 >


AD Administrator Syncfusion Team April 21, 2005 02:16 PM UTC

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 >> > > > >

Loader.
Live Chat Icon For mobile
Up arrow icon