This question is locked. New answers and comments are not allowed.
Hi ,
Currently I have a GridView which has HTMLPlaceHolder holder and being loaded dynamically.I want to set the border for each row but for some reason is not showing up.The other issue I have is to show the tooltip on the cell which has HTMLPlaceHolder for each row.Please let me know how to set border and tooltip for each row
Here is the sample code I have done
public override FrameworkElement CreateCellElement(GridViewCell cell, object dataItem)
{
RadHtmlPlaceholder cellElement = null;
//TextBox cellElement = null;
// Brush test=((Telerik.Windows.Controls.GridView.GridViewRow)(((Telerik.Windows.Controls.GridView.GridViewCellBase)(cell)).BorderBrush
Object TypeForCompare = ((HtmlContents)dataItem).Content;
if (TypeForCompare is ServiceReference1.Para)
{
cellElement = new RadHtmlPlaceholder();
((RadHtmlPlaceholder)cellElement).HtmlSource = ((ServiceReference1.Para)TypeForCompare)._entireStream;
((RadHtmlPlaceholder)cellElement).Height = 200;
//cellElement = new TextBox();
//cellElement.Text = ((ServiceReference1.Para)TypeForCompare)._entireStream;
cellElement.SetValue(ToolTipService.ToolTipProperty,((ServiceReference1.Para)TypeForCompare)._title);
SolidColorBrush colorBrush = new SolidColorBrush();
colorBrush.Color = Colors.Red;
cell.BorderBrush = colorBrush;
//cell.BorderThickness = new Thickness(5);
//cell.BorderBrush = colorBrush
//cell.ParentRow.BorderBrush = colorBrush;
//cell.ParentRow.BorderThickness = new Thickness(5);
ControlCreated(cellElement, ((ServiceReference1.Para)TypeForCompare)._title,cell.ParentRow);
//((RadHtmlPlaceholder)cellElement).Width=600;
this.Width = 800;
}
//else //if (TypeForCompare is ServiceReference1.ParsedTable)
//{
// cellElement = new RadHtmlPlaceholder();
// //((RadGridView)cellElement).ShowGroupPanel = false;
// //((RadGridView)cellElement).AutoGenerateColumns = true;
// //((RadGridView)cellElement).ItemsSource = CreatePersonsObservableCollection();
// //((RadGridView)cellElement).Height = 200;
// ((RadHtmlPlaceholder)cellElement).HtmlSource = ((ServiceReference1.ParsedTable)TypeForCompare)._des;
// ((RadHtmlPlaceholder)cellElement).Height = 200;
// this.Width = 800;
//}
//cellElement.CornerRadius = new CornerRadius(5);
//ControlCreated(cellElement, ((ServiceReference1.ParsedTable)TypeForCompare)._title, cell.ParentRow);
return cellElement;
}
Currently I have a GridView which has HTMLPlaceHolder holder and being loaded dynamically.I want to set the border for each row but for some reason is not showing up.The other issue I have is to show the tooltip on the cell which has HTMLPlaceHolder for each row.Please let me know how to set border and tooltip for each row
Here is the sample code I have done
public override FrameworkElement CreateCellElement(GridViewCell cell, object dataItem)
{
RadHtmlPlaceholder cellElement = null;
//TextBox cellElement = null;
// Brush test=((Telerik.Windows.Controls.GridView.GridViewRow)(((Telerik.Windows.Controls.GridView.GridViewCellBase)(cell)).BorderBrush
Object TypeForCompare = ((HtmlContents)dataItem).Content;
if (TypeForCompare is ServiceReference1.Para)
{
cellElement = new RadHtmlPlaceholder();
((RadHtmlPlaceholder)cellElement).HtmlSource = ((ServiceReference1.Para)TypeForCompare)._entireStream;
((RadHtmlPlaceholder)cellElement).Height = 200;
//cellElement = new TextBox();
//cellElement.Text = ((ServiceReference1.Para)TypeForCompare)._entireStream;
cellElement.SetValue(ToolTipService.ToolTipProperty,((ServiceReference1.Para)TypeForCompare)._title);
SolidColorBrush colorBrush = new SolidColorBrush();
colorBrush.Color = Colors.Red;
cell.BorderBrush = colorBrush;
//cell.BorderThickness = new Thickness(5);
//cell.BorderBrush = colorBrush
//cell.ParentRow.BorderBrush = colorBrush;
//cell.ParentRow.BorderThickness = new Thickness(5);
ControlCreated(cellElement, ((ServiceReference1.Para)TypeForCompare)._title,cell.ParentRow);
//((RadHtmlPlaceholder)cellElement).Width=600;
this.Width = 800;
}
//else //if (TypeForCompare is ServiceReference1.ParsedTable)
//{
// cellElement = new RadHtmlPlaceholder();
// //((RadGridView)cellElement).ShowGroupPanel = false;
// //((RadGridView)cellElement).AutoGenerateColumns = true;
// //((RadGridView)cellElement).ItemsSource = CreatePersonsObservableCollection();
// //((RadGridView)cellElement).Height = 200;
// ((RadHtmlPlaceholder)cellElement).HtmlSource = ((ServiceReference1.ParsedTable)TypeForCompare)._des;
// ((RadHtmlPlaceholder)cellElement).Height = 200;
// this.Width = 800;
//}
//cellElement.CornerRadius = new CornerRadius(5);
//ControlCreated(cellElement, ((ServiceReference1.ParsedTable)TypeForCompare)._title, cell.ParentRow);
return cellElement;
}