This is a migrated thread and some comments may be shown as answers.

radgrid disabled setting problems

3 Answers 125 Views
GridView
This is a migrated thread and some comments may be shown as answers.
B
Top achievements
Rank 1
B asked on 05 May 2008, 06:26 AM
I created a radgrid that gets refreshed every 2 seconds with new data.

I noticed that if the user is resizing a column during the refresh it causes an error.

To stop this from happening, before the refresh takes place I set the grid.enabled = false.  This solves that problem, but, everytime the data is refreshed, it seems the grid flashes a quick gray overlay color.  I can still see the data but there is just a flash of gray.

How can I get rid of this grey color?  I dont want any visual changes when the grid is not enabled?

If there is a better way around the problem of the grid resize on datasource update then please also let me know!!

3 Answers, 1 is accepted

Sort by
0
Accepted
Kiril
Telerik team
answered on 05 May 2008, 02:52 PM
Hi B,

Thank you for writing.

Everytime you change the datasource, the RadGridView builds its column collection and its visual representation thereof anew. This is the reason that resizing the columns during a databind operation at this point might not be advisable. Still, we will look at this issue, and will prevent this issue for occurring in the future.

If the columns in the datasource you're using do not change in between refreshes, you can refresh the data in the current datasource, which is already bound to the RadGridView. If you do that, only the data inside the grid will be refreshed, while the columns will stay the same. This will not only solve the immediate issue you're facing, but also allow you to get a significant performance improvement, and dramatically decrease the time it takes to show the new values in the RadGridView.

Please refer to the High Refresh example in the RadGridView section of our Examples application. It shows a case where the datasource is updated very often.

Although I encourage you to follow the approach outlined above and update the values in the bound datasource, instead of binding a new one on every time period, I realize in your particular case, that might need too big of a time investment.

A workaround you can use using your current approach is to set the AllowColumnResize property of the MasterGridViewTemplate (or the ViewTemplate you're rebinding) to false before rebinding. This will prevent the user from resizing the columns. You can re-enable the column resizing after the RadGridView is rebound with the new data. Still, to a user resizing a column during a rebind operation, this behavior will appear unnatural.

From the viewpoint of user experience, and application performance (outlined above), I highly recommend using the approach described above, i.e. updating the values in the bound dataset, instead of binding a new dataset at every time period.

Please let us know if you need any further assistance using our product in a frequent-refresh scenario. We'd be happy to assist you put our product to your maximum benefit.

Greetings,
Kiril
the Telerik team

Instantly find answers to your questions at the new Telerik Support Center
0
B
Top achievements
Rank 1
answered on 06 May 2008, 03:23 PM
Thank you very much.

The example solutions works much much better and faster.
0
Kiril
Telerik team
answered on 06 May 2008, 03:32 PM
Hi B,

I'm happy to hear the issue has now been addressed. In the future, when you experience a similar situation, where you have to forcefit our product to your particular needs (such as enabling/disabling the control upon rebinding), please consult with our examples, the documentation, the online resources, or you can contact us for an easier way to achieve your desired functionality. Our support service is here to help you use our product to take your application to the next level.

Kind regards,
Kiril
the Telerik team

Instantly find answers to your questions at the new Telerik Support Center
Tags
GridView
Asked by
B
Top achievements
Rank 1
Answers by
Kiril
Telerik team
B
Top achievements
Rank 1
Share this question
or