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.

ProgressBar cell in GridDataBoundGrid

Thread ID:

Created:

Updated:

Platform:

Replies:

21558 Nov 15,2004 12:13 AM Nov 15,2004 03:12 AM Windows Forms 1
loading
Tags: GridControl
San Chen
Asked On November 15, 2004 12:13 AM

I''ve used a GridDataBoundGrid in my project, and one of the GridBoundColumn''s CellType is ProgressBar. The progressbar''s value is dynamically changed when the dataset''s value is changed. When the program runs, the progressbar seems ok at the begining, but it will become a mass when redrawing. Another question: If I set the ProgressBar''s TextStyle to Custome, how can I set the Text of the ProgressBar. Thanks. the code is as below: private void usptoGrabProgressGridDataBoundGrid_PrepareViewStyleInfo(object sender, Syncfusion.Windows.Forms.Grid.GridPrepareViewStyleInfoEventArgs e) { if(e.RowIndex == 0 || e.ColIndex == 0) return; int randomNumber = rng.Next(8, 12) * 100000; // this is used to simulate dynamically changed data // all rows should have a 100% filled progressbar, but they don''t, why? e.Style.ProgressBar.ProgressValue = e.Style.ProgressBar.Maximum = randomNumber; }

Administrator [Syncfusion]
Replied On November 15, 2004 03:12 AM

PrepareViewStyleInfo is only hit for a cell when that cell is being redrawn. If you do not do something to trigger the redraw when the underlying progress value changes (like call RefreshRange), then the cell will not change what is displayed. Here is a little sample that has a column of progressbars. It uses a timer to change the underlying value, and when it does, it also calls grid.RefreshRange so the cell is redrawn using the new values. It uses mode.QueryCellInfo to provide the value (instead of PrepareViewStyleInfo, but I think both should work). If you continue to have problems with PrepareViewStyleInfo, you could move your code to a Model.QueryCellInfo event handler to see if that will work better. GDBGProgressBar5018_9433.zip

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.

;