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.
Syncfusion Feedback

GridGroupingControl, change a text cell to progress bar

Thread ID:

Created:

Updated:

Platform:

Replies:

96285 Sep 2,2010 03:47 PM Sep 6,2010 05:26 AM Windows Forms 3
loading
Tags: GridControl
Shawn Benson
Asked On September 2, 2010 03:47 PM

When I click on a button to do some work for a row in a GridGroupingControl, I would like to change a cell in that row to a progress bar. I do not seem to be able to fine out how to do this, any help would be appreciated.

Thanks,

Shawn.


Jisha Joy [Syncfusion]
Replied On September 3, 2010 06:28 AM

Hi,

You can handle PrepareViewStyleInfo event of the GridGrouping Control and set the celltype as progressbar.

Here is the code:


this.gridGroupingControl1.TableControl.PrepareViewStyleInfo += new Syncfusion.Windows.Forms.Grid.GridPrepareViewStyleInfoEventHandler(TableControl_PrepareViewStyleInfo);

void TableControl_PrepareViewStyleInfo(object sender, Syncfusion.Windows.Forms.Grid.GridPrepareViewStyleInfoEventArgs e)
{
if (e.RowIndex == 7 && e.ColIndex == 2)
{
e.Style.CellType = "ProgressBar";
}
}


Here is the sample:
http://www.syncfusion.com/support/user/uploads/GGCProgressBar_135a40c4.zip

Please let me know if this helps.

Regards,
Jisha


Shawn Benson
Replied On September 3, 2010 12:23 PM

Thanks for the help. If works, but when I try to update/animate the progress bar it is not working. It still is coming through as a sting when I grab the style, not a progress bar. sample is below.

private void buttonAdv1_Click_1(object sender, EventArgs e)
{
Animate(true);
}

System.Windows.Forms.Timer timer = new System.Windows.Forms.Timer();

void Animate(bool enabled)
{
if (enabled)
{
timer.Tick += new EventHandler(timer_Tick);
timer.Interval = 10;
timer.Enabled = true;
timer.Start();
}
else
{
timer.Tick -= new EventHandler(timer_Tick);
timer.Stop();
}
}

private void timer_Tick(object sender, EventArgs e)
{
Record r = this.gridGroupingControl1.Table.CurrentRecord;

this.gridGroupingControl1.BeginUpdate();

GridTableCellStyleInfo stylev = this.gridGroupingControl1.Table.GetTableCellStyle(r, "ProcessStatus");

GridProgressBarInfo progressBarExv = stylev.ProgressBar;
int pvaluev = (progressBarExv.ProgressValue + 3) % 100;
progressBarExv.ProgressValue = pvaluev;

gridGroupingControl1.EndUpdate(true);
Application.DoEvents();
}


Jisha Joy [Syncfusion]
Replied On September 6, 2010 05:26 AM

Hi Shawn,

Please see the following sample that shows animated progressbar in grid cells.

http://www.syncfusion.com/uploads/redirect.aspx?&team=support&file=sampl122052282261.zip

Regards,
Jisha




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.

Warning Icon 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.Close Icon

;