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 tooltip based on the value of a different cell

Thread ID:

Created:

Updated:

Platform:

Replies:

92763 Feb 3,2010 11:54 AM UTC Feb 9,2010 08:59 AM UTC WinForms 3
loading
Tags: Grouping
Kannan Venkataramani
Asked On February 3, 2010 11:54 AM UTC

Hi,

Searching the forums, came across this one, but the example leads me to a dead link.

http://www.syncfusion.com/support/forums/grouping%20-windows/20572/Setting-Cell-Tool-Tip-via-eInnerStyleCellTipText

I need to set the tooltip for each of the cells in a column based on the value of a different column.

this is what i tried and dosent seem to do the trick.

private void gridPending_TableControlPrepareViewStyleInfo( object sender, GridTableControlPrepareViewStyleInfoEventArgs e )
{
if ( e.Inner.ColIndex > 0 && e.Inner.RowIndex > 2 )
{
//if ( gridPending.TableModel[e.Inner.RowIndex, gridPending.TableModel.NameToColIndex( "AltLocRequired" )].CellValue.ToString().Trim() == "Y" )
//{
// gridPending.TableModel[e.Inner.RowIndex, gridPending.TableModel.NameToColIndex( "Approve" )].CellTipText = "Alternate Location required";
//}
}
}

Lingaraj S [Syncfusion]
Replied On February 4, 2010 09:15 AM UTC

Hi Kannan,

Thank you for your interest in Syncfusion products.

Please try using below way in GridGroupingControl to show the Cell ToolTip based on another column value as shown below.

this.gridGroupingControl1.QueryCellStyleInfo += new GridTableCellStyleInfoEventHandler(gridGroupingControl1_QueryCellStyleInfo);
void gridGroupingControl1_QueryCellStyleInfo(object sender, GridTableCellStyleInfoEventArgs e)
{
if (e.TableCellIdentity.Column != null
&& e.TableCellIdentity.DisplayElement.Kind == DisplayElementKind.Record
&& e.TableCellIdentity.Column.Name == "Approve")
{
object val = e.TableCellIdentity.DisplayElement.GetRecord().GetValue("AltLocRequired");
if (val != null && val.Equals("Y"))
{
e.Style.CellTipText = "Alternate Location required";
}
}
}


Refer the simple sample from below link for your reference.
http://www.syncfusion.com/uploads/redirect.aspx?&team=support&file=GGCControl1002668115.zip

Please let me know if you have any queries.

Regards,
Lingaraj S.

Kannan Venkataramani
Replied On February 5, 2010 04:38 PM UTC

Hi Lingaraj,

Thanks for the help, my situation is a bit different, my grid is bound to a Dataset and the Dataset is updated by a backend EMS data provider, and its updated as and when trades come in.

So the querycellinfo dosent seem to fire on such occasions, so is there any other way to set the tooltip.

Lingaraj S [Syncfusion]
Replied On February 9, 2010 08:59 AM UTC

Hi Kannan,

Thank you for the update.

Try using Refresh method in SourceListListChanged event to fire the QueryCellInfo event while updaing datasource as shown below.

this.gridGroupingControl1.SourceListListChanged += new TableListChangedEventHandler(gridGroupingControl1_SourceListListChanged);
void gridGroupingControl1_SourceListListChanged(object sender, TableListChangedEventArgs e)
{
this.gridGroupingControl1.Refresh();
}


Please let me know if you have any queries.

Regards,
Lingaraj S.

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

;