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.

Rich Text in a grid grouping control

Thread ID:

Created:

Updated:

Platform:

Replies:

31129 Jun 30,2005 09:28 AM Jul 7,2005 12:19 PM Windows Forms 9
loading
Tags: GridControl
Jonathan Urban
Asked On June 30, 2005 09:28 AM

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

Administrator [Syncfusion]
Replied On June 30, 2005 09: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

Jonathan Urban
Replied On June 30, 2005 10: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

Administrator [Syncfusion]
Replied On June 30, 2005 11: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

Jonathan Urban
Replied On July 7, 2005 02: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.

Administrator [Syncfusion]
Replied On July 7, 2005 05: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?

Jonathan Urban
Replied On July 7, 2005 10:01 AM

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

Administrator [Syncfusion]
Replied On July 7, 2005 10: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

Jonathan Urban
Replied On July 7, 2005 10:34 AM

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

Administrator [Syncfusion]
Replied On July 7, 2005 12:19 PM

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;
}

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.

;