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. (Last updated on: November 16, 2018).
Unfortunately, activation email could not send to your email. Please try again.
Syncfusion Feedback

Cell Comments in GridControl

Thread ID:

Created:

Updated:

Platform:

Replies:

63359 Jul 3,2007 08:56 AM UTC Jul 5,2007 08:55 PM UTC WinForms 3
loading
Tags: GridControl
Hans Georg-Von-Bismarck
Asked On July 3, 2007 08:56 AM UTC

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).

haneefm [Syncfusion]
Replied On 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

Hans Georg-Von-Bismarck
Replied On 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

haneefm [Syncfusion]
Replied On 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

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.

Warning Icon 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.Close Icon

;