The Syncfusion® native Blazor components library offers 70+ UI and Data Viz web controls that are responsive and lightweight for building modern web apps.
.NET PDF framework is a high-performance and comprehensive library used to create, read, merge, split, secure, edit, view, and review PDF files in C#/VB.NET.
Hi,
I am using Syncfusion Grid Grouping Control - V 3.2.1.0 and i need to format text in the cell. I have reffered Syncfusion sample -
Essential Grid Samples - Cell Types- Rich Text Cells.
However this allows editing of the cell. How do we disable this?
Thanks in advance.
ADAdministrator Syncfusion Team June 27, 2006 04:26 PM UTC
Hi Deepa,
Regarding the Question 1: Format the cells.
The TextFormat browser sample shows you how to format the data in your grid. You can see the code that formats numbers and dates. It also has code that does the validation on the cell values as you leave the cell. Essential Grid uses the .Net Framework formatting support so that there is no additional learning curve involved. As a result of the .Net Framework, the formatting is culture sensitive.
Here is a path.
Essential Grid Samples - >Quick Start ->TextFormat.
Syncfusion\Essential Studio\4.2.0.37\windows\Grid.Windows\Samples\Quick Start\TextFormat
Regarding the Question 2:
You need to handle the CurrentCellshowngDropDown event for cancelling the editing of the dropdown RichTextBox cell in a grid. Here is a code snippet.
GridCurrentCell cc = this.gridControl1.CurrentCell;
GridRichTextBoxCellRenderer cr = cc.Renderer as GridRichTextBoxCellRenderer;
if( cr!= null)
{
foreach(Control c in cr.DropDownContainer.Controls)
{
if ( c is GridRichTextEntryPanel)
{
GridRichTextEntryPanel panel = c as GridRichTextEntryPanel;
foreach(Control subc in panel.Controls)
{
if( subc is RichTextBox)
{
RichTextBox rich = subc as RichTextBox;
rich.ReadOnly = true;
}
}
}
}
}
Let me know if this helps.
Best Regards,
Haneef
ADAdministrator Syncfusion Team June 27, 2006 05:38 PM UTC
Hi,
I want to use Rich Text Format. I want to format the text based on colors. Also i dont want the drop down button itself. Please refer to Syncfusion\Essential Studio\3.2.1.0\Windows\Grid.Windows\Samples\CellTypes\RichTextCells.
Thanks
>Hi Deepa,
>
>Regarding the Question 1: Format the cells.
>
>The TextFormat browser sample shows you how to format the data in your grid. You can see the code that formats numbers and dates. It also has code that does the validation on the cell values as you leave the cell. Essential Grid uses the .Net Framework formatting support so that there is no additional learning curve involved. As a result of the .Net Framework, the formatting is culture sensitive.
>
>Here is a path.
>Essential Grid Samples - >Quick Start ->TextFormat.
>Syncfusion\Essential Studio\4.2.0.37\windows\Grid.Windows\Samples\Quick Start\TextFormat
>
>Regarding the Question 2:
>
>You need to handle the CurrentCellshowngDropDown event for cancelling the editing of the dropdown RichTextBox cell in a grid. Here is a code snippet.
>
>GridCurrentCell cc = this.gridControl1.CurrentCell;
>GridRichTextBoxCellRenderer cr = cc.Renderer as GridRichTextBoxCellRenderer;
>if( cr!= null)
>{
> foreach(Control c in cr.DropDownContainer.Controls)
> {
> if ( c is GridRichTextEntryPanel)
> {
> GridRichTextEntryPanel panel = c as GridRichTextEntryPanel;
> foreach(Control subc in panel.Controls)
> {
> if( subc is RichTextBox)
> {
> RichTextBox rich = subc as RichTextBox;
> rich.ReadOnly = true;
>
> }
> }
> }
> }
>}
>
>Let me know if this helps.
>Best Regards,
>Haneef
ADAdministrator Syncfusion Team June 27, 2006 07:13 PM UTC
Hi Deepa,
Regarding the drop down button:
Try setting the ShowButtons property to GridShowButtons.Hide to hide the dropdown button in a cell. Here is a code snippet
this.gridControl1.TableStyle.ShowButtons = GridShowButtons.Hide;
Regarding the text formatting based on selection color:
To format the text based on selection color of the RichText cell in a grid, you need to handle the PrepareViewStyleInfo event. Here is a code snippet.
if(e.Style.CellType == "RichText" && e.Style.Tag == null)
{
RichTextBox rich = new RichTextBox();
this.gridControl1[e.RowIndex,e.ColIndex].Tag = true;
rich.Rtf = e.Style.Text;
for( int i = 0;i<=rich.TextLength;i++)
{
rich.SelectionStart = i;
Color oldColor = rich.SelectionColor;
for( int j= i;j
Need More Help?
Get personalized assistance from our support team.