Thread ID: |
Created: |
Updated: |
Platform: |
Replies: |
11377 | Mar 4,2004 02:08 AM UTC | Jun 8,2004 08:47 PM UTC | WinForms | 8 |
![]() |
Tags: GridControl |
private RichTextBox rtb = new RichTextBox(); private void button1_Click(object sender, System.EventArgs e) {// cell 3,1 is richtext, code colors chars 3-6. rtb.Rtf = this.gridControl1[3,1].Text; rtb.SelectionStart = 2; rtb.SelectionLength = 4; rtb.SelectionColor = Color.Pink; this.gridControl1[3,1].Text = rtb.Rtf; }If you want to add the ability to change text color to the drop down panel that you get when you click the button in the richtext cell, then one way to do this is to derive GridRichTextEntryPanel, adding the toolbar item to implement color selection some how. You could use the code snippet above to actually affect the color change. Then you would derive GridRichTextBoxCellModel and GridRichTextBoxCellRenderer to make the cell control use your derived entry panel. All of the work would be in GridRichTextBoxCellRenderer where you would swap the code that uses the private panel member of that class so that in the derived class, the panel would be an instance of your derived panel.
>private RichTextBox rtb = new RichTextBox(); > >private void button1_Click(object sender, System.EventArgs e) >{// cell 3,1 is richtext, code colors chars 3-6. > rtb.Rtf = this.gridControl1[3,1].Text; > rtb.SelectionStart = 2; > rtb.SelectionLength = 4; > rtb.SelectionColor = Color.Pink; > this.gridControl1[3,1].Text = rtb.Rtf; >} >> >If you want to add the ability to change text color to the drop down panel that you get when you click the button in the richtext cell, then one way to do this is to derive GridRichTextEntryPanel, adding the toolbar item to implement color selection some how. You could use the code snippet above to actually affect the color change. > >Then you would derive GridRichTextBoxCellModel and GridRichTextBoxCellRenderer to make the cell control use your derived entry panel. All of the work would be in GridRichTextBoxCellRenderer where you would swap the code that uses the private panel member of that class so that in the derived class, the panel would be an instance of your derived panel.
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.
This page will automatically be redirected to the sign-in page in 10 seconds.