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

Rich Text in a grid grouping control

I would like to apply a rich text in a grid grouping control, it is possible?

9 Replies

AD Administrator Syncfusion Team June 30, 2005 08:55 AM

You can set the CellType = "RichText". Here is a link showing how to do this in a GridControl. Using it in a GridGroupingControl should be similar if your datasource contains rtf. \Syncfusion\Essential Studio\3.2.1.0\Windows\Grid.Windows\Samples\CellTypes\RichTextCells


JU Jonathan Urban June 30, 2005 09:37 AM

I have already view this article but it doesn''t work. Can you please give me a sample of code? >You can set the CellType = "RichText". Here is a link showing how to do this in a GridControl. Using it in a GridGroupingControl should be similar if your datasource contains rtf. >\Syncfusion\Essential Studio\3.2.1.0\Windows\Grid.Windows\Samples\CellTypes\RichTextCells


AD Administrator Syncfusion Team June 30, 2005 10:13 AM

Here is a sample. The only thing you need to be careful about is that your datasource must contain properly formatted richtext. http://www.syncfusion.com/Support/user/uploads/GGC_RTF_b5f28f28.zip


JU Jonathan Urban July 7, 2005 01:11 AM

THX for your reply. But now, I have more 2 problems and I think they are linked... First, when I change the value of CellType like this : this.gridProtokoll.TableDescriptor.Columns[1].Appearance.AnyRecordFieldCell.CellType = "RichText"; ,all columns of my grid grouping control are rezised. Endly, if I update the grid content with a new datasource, the Rich Text column become empty.


AD Administrator Syncfusion Team July 7, 2005 04:21 AM

If you can upload a sample that shows these problems, we can try to spot what is happening here. Can you modify the sample from above to show these problems?


JU Jonathan Urban July 7, 2005 09:01 AM

here is a sample in order to show you my problem: ftp://sirius.uha.fr/transit/GGC_RTF.zip


AD Administrator Syncfusion Team July 7, 2005 09:22 AM

Thank you for your sample. The grid has no way to do a ResizeToFit for RichText. You can use code like this to explicitly set the size of a column if that will serve your purposes. this.gridGroupingControl1.TableDescriptor.Columns[1].Width = 250; If you have a way of determining the size that you want to see for the cell, then setting GridColumnDescriptor.Width property will be the simplest thing to do. I know of no straight-forward .NET Framework methods that will allow you to compute the size of RTF. Here is a forum post that has an InPlaceRichTextBox cell control that has an attempt at supportting autosizing. If you need teh autosize calculation to try to perfectly set GridColumnDescriptor.Width, then you coul dtry using the technique from that sample. http://www.syncfusion.com/Support/Forums/message.aspx?MessageID=15023


JU Jonathan Urban July 7, 2005 09:34 AM

Okay for the Rich Text Column but why if I resize larger others Columns, there isn''t the horizontal scroll bar ?


AD Administrator Syncfusion Team July 7, 2005 11:19 AM

Try this code:
private void button1_Click(object sender, System.EventArgs e)
{
	DataSet ds = new DataSet();
	ds.ReadXml("data1.xml");
	this.gridGroupingControl1.DataSource = ds.Tables[0];
	Application.DoEvents();
	this.gridGroupingControl1.TableDescriptor.Columns[1].Appearance.AnyRecordFieldCell.CellType = "RichText";
	this.gridGroupingControl1.TableDescriptor.Columns[1].Appearance.AnyRecordFieldCell.BackColor = Color.LightGoldenrodYellow;
}
This shows up OK for me in your sample without explicitly setting the colwidth. If you want to set the colwidth, then call another Apllication.DoEvents so all the settings get applied.
private void button1_Click(object sender, System.EventArgs e)
{
	DataSet ds = new DataSet();
	ds.ReadXml("data1.xml");
	this.gridGroupingControl1.DataSource = ds.Tables[0];
	Application.DoEvents();
	this.gridGroupingControl1.TableDescriptor.Columns[1].Appearance.AnyRecordFieldCell.CellType = "RichText";
	this.gridGroupingControl1.TableDescriptor.Columns[1].Appearance.AnyRecordFieldCell.BackColor = Color.LightGoldenrodYellow;
	Application.DoEvents();
	this.gridGroupingControl1.TableDescriptor.Columns[1].Width = 200;
}

Loader.
Live Chat Icon For mobile
Up arrow icon