Hi,
Pls see the attached pics, and senario is like, grid is in penal and data of the grid is keep on changing with other events(like: tree node selection). as scrollbar is coming into the grid, the summary lable is displacing from its location.
pls take it on priority.
Thanks
Vivek
>Hi Vivek,
One way you can do this is to add the Label control on the grid and handle a TableControlDrawCell event to set required property(like Location,Size,Text and BackColor) of the Label. Here is a code snippet to show this.
private void gridGroupingControl1_TableControlDrawCell(object sender, Syncfusion.Windows.Forms.Grid.Grouping.GridTableControlDrawCellEventArgs e)
{
GridTableCellStyleInfo style = e.Inner.Style as GridTableCellStyleInfo;
if( style.TableCellIdentity.TableCellType == GridTableCellType.SummaryTitleCell )
{
e.Inner.Cancel = true;
string sText = e.Inner.Style.Text;
this.label1.Text = e.Inner.Style.Text;
this.label1.Location = new Point(e.Inner.Bounds.Location.X,e.Inner.Bounds.Location.Y +2) ;
this.label1.BackColor = e.Inner.Style.BackColor;
int width = (int)e.Inner.Graphics.MeasureString(sText,e.Inner.Style.GdipFont).Width;
this.label1.Size = new Size(width + 1,e.Inner.Bounds.Height - 3 );
}
}
Here is a sample.
http://www.syncfusion.com/Support/user/uploads/GGCSummaryLabel_7bede63f.zip
Best Regards,
Haneef
error49.zip