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