hi,
I have created template column throught code-behind .In that i custmize the headerTemplate.It contain Image and textbox which placed in stackpanel container.In image we add Tool Tip. It is working with Default style of grid but if i apply custum style to grid then ToolTip is not seen.
Please give the solution....
Thanks in advanced
Hi,
Do you have a sample that shows this problem?
-SteveZ
I write this code in objGrid_ColumnLayoutAssigned
// Code for Cell Template
StringBuilder CellETemp = new StringBuilder();
CellETemp.Append("<DataTemplate ");
CellETemp.Append("xmlns='http://schemas.microsoft.com/winfx/2006/xaml/presentation'");
CellETemp.Append("xmlns:x='http://schemas.microsoft.com/winfx/2006/xaml'>");
CellETemp.Append(" <Grid x:Name=\"LayoutRoot\" Background=\"Transparent\" Width=\"119\">");
CellETemp.Append(" <Grid.ColumnDefinitions>" );
CellETemp.Append(
" <ColumnDefinition x:Name=\"ColValue\" Width=\"117\"></ColumnDefinition>");
" </Grid.ColumnDefinitions>");
" <TextBox x:Name=\"txtValue\" HorizontalAlignment=\"Center\" TextAlignment=\"Right\" Text=\"{Binding " + strHeader + " ,Mode=TwoWay}\" VerticalAlignment=\"Center\" Grid.Column=\"0\" Height=\"20\" Width=\"105\" Background=\"#FFF7F8F8\"></TextBox>");
" </Grid>");CellETemp.Append(" </DataTemplate>");
// Code For Header Template
StringBuilder HeaderTemp = new StringBuilder();
HeaderTemp.Append(
"<DataTemplate ");
"xmlns='http://schemas.microsoft.com/winfx/2006/xaml/presentation' ");
"xmlns:x='http://schemas.microsoft.com/winfx/2006/xaml' xmlns:tooltip='clr-namespace:Silverlight.Controls;assembly=ExtendedControls'> ");
" <StackPanel Orientation= \"Horizontal\">");
" <TextBlock x:Name=\"txtNormal\" Text=\"{Binding Converter={StaticResource HeaderConverter}, ConverterParameter='" + strPeriod + "'}\" HorizontalAlignment=\"Right\" />");
" <Image x:Name=\"imgNotes\" Source= \"../../images/notes.jpg \" Height=\"11\" Width=\"11\" >");
" <tooltip:ToolTipService.ToolTip>" +"<tooltip:ToolTip InitialDelay=\"0\" ShowDuration=\"30\">"+ "<TextBlock x:Name=\"txtNotes\" Text=\"TooltipTest\" Width=\"90\" FontSize=\"11\" FontFamily=\"Arial\" VerticalAlignment=\"Top\" TextAlignment=\"Left\"/>"+"</tooltip:ToolTip>"+"</tooltip:ToolTipService.ToolTip>");
" </Image>");
" </StackPanel>");
" </DataTemplate>");
e.ColumnLayout.Columns.Add(
HeaderText = app.objBizDisplay.PeriodNameDictionary[app.objBizDisplay.ArrPeriodID[icrt]],Key = strHeader, MinimumWidth = 60,
Width =
new ColumnWidth(iWidth, false),IsSortable = false ,IsResizable =true,
HeaderTemplate = (
DataTemplate)XamlReader.Load(HeaderTemp.ToString()),
ItemTemplate = (
DataTemplate)XamlReader.Load(CellTemp.ToString()) });
this code working with Degault Style and i get ToolTip on headerColumn Image of XamGriD.
But If i apply style for Grid either at desinTime or Runtime the Tooltip is not seen
Please Reply...
The more information you can provide upfront the better. And if you have a sample that you can send, we can generally get to the bottom of a problem a lot quicker.
I still need more information from you. Like what are you setting a style on. What style are you setting? What are you doing in the style etc...
Really if you could attach a sample that would be best.
Thanks,
Thanks SteveZ
It just shouldn't have anything positioned over it. It doesn't have to be last.
So you mean ContentPresenter should be last at the ControlTemplate......
I believe it's b/c the mouse is being handled on the Dragger rectangle, which mean the tooltip is not getting notified that the mouse is over the contentPresenter.
Thank you Steve... Its Work.
But please can u explane me what was the issue.Because i commented Dragger Rectangle then it was also worked.
I havent worked so much on style,ContentPresenter,ControlTemplate etc. so please explane . . .