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

Cell Comments in GridControl

Sirs,
I have the following problem:
I have a gridcontrol (version 5) which has the header cells merged and not numbered.
My question:
I tried to add a tooltip, but this doesn't work because the text is too long (I can't resize it).
I therefore thought of a cell comment. The comment works fine, but the red triangle is not shown. I beleive it's behind in the merged cell.
(I copied the sample of cellcomments)
(System: C# VS2005).

3 Replies

HA haneefm Syncfusion Team July 3, 2007 10:59 PM UTC

Hi Hans,

Try changing the add_Comment method in CommentMouseController.cs to below code snippets. Please refer to the attached sample for implementation and let me know if this helps.

private void add_Comment(object sender, EventArgs e)
{
GridRangeInfo info;
bool b = owner.Model.CoveredRanges.Find(rightClickRow, rightClickCol, out info);
GridExcelTipStyleProperties style;
if (b)
style = new GridExcelTipStyleProperties(owner.Model[info.Top, info.Left]);
else
style = new GridExcelTipStyleProperties(owner.Model[rightClickRow, rightClickCol]);
style.ExcelTipText = "";
StartEditing();
}

Here is a sample.
CellCommentTips.zip

Best regards,
Haneef


HG Hans Georg-Von-Bismarck July 5, 2007 08:51 AM UTC

Hi Haneef,

I fixed that problem, it works now.
I have another need now:

The interior of the grid should contain cells of the following type (usercontrol):
-Combobox with exclusive choice list showing values from 1 - 5 and N/A
-Button for editing a richtextbox (inside the same cell, which would be an "Editable Tooltip")
-A custom Tag which includes the row headers and additional info class.
Could you send me a renderer / modell which coontains such definitions (at least for a usercontrol)? Thanks in advance

Hans




>Hi Hans,

Try changing the add_Comment method in CommentMouseController.cs to below code snippets. Please refer to the attached sample for implementation and let me know if this helps.

private void add_Comment(object sender, EventArgs e)
{
GridRangeInfo info;
bool b = owner.Model.CoveredRanges.Find(rightClickRow, rightClickCol, out info);
GridExcelTipStyleProperties style;
if (b)
style = new GridExcelTipStyleProperties(owner.Model[info.Top, info.Left]);
else
style = new GridExcelTipStyleProperties(owner.Model[rightClickRow, rightClickCol]);
style.ExcelTipText = "";
StartEditing();
}

Here is a sample.
CellCommentTips.zip

Best regards,
Haneef


HA haneefm Syncfusion Team July 5, 2007 08:55 PM UTC

Hi Hans,

-Combobox with exclusive choice list showing values from 1 - 5 and N/A
>>>>>>>>>>>>>>>>>>
You can set the celltype of the cell to ComboBox and set the DropDownStyle property to GridDropDownStyle.Exclusive. Below are the code snippet.

this.gridGroupingControl1.TableDescriptor.Columns[1].Appearance.AnyRecordFieldCell.CellType = "ComboBox";
StringCollection sc = new StringCollection();
sc.Add(string.Empty);
for(int i = 1;i<=5;i++)
sc.Add(i.ToString());

this.gridGroupingControl1.TableDescriptor.Columns[1].Appearance.AnyRecordFieldCell.ChoiceList = sc;
this.gridGroupingControl1.TableDescriptor.Columns[1].Appearance.AnyRecordFieldCell.DropDownStyle = GridDropDownStyle.Exclusive;

-Button for editing a richtextbox (inside the same cell, which would be an "Editable Tooltip")
>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
You can try setting the celltype of the cell to RichText.

this.gridGroupingControl1.TableDescriptor.Columns[2].Appearance.AnyRecordFieldCell.CellType = "RichText";

-A custom Tag which includes the row headers and additional info class.
>>>>>>>>>>>>>
Below is a forum thread that shows this task.
http://www.syncfusion.com/support/Forums/message.aspx?&MessageID=39135

It contains two samples. First provide the evidence for applying the CustomProperty to all the cells in the grid through the static constructor of the derived GridStyleInfoCustomProperties class. Second demostrates a way to have a custom property which is used by a derived CellModel and CellRenderer to customize the cell.

Best regards,
Haneef

Loader.
Live Chat Icon For mobile
Up arrow icon