RadGrid for ASP.NET

RadGrid Send comments on this topic.
SelectedItemStyle Property
See Also  Example
Telerik.WebControls Namespace > GridTableView Class : SelectedItemStyle Property


Gets a reference to the Style object that allows you to set the appearance of the selected item in a GridTableView control.   

 

Namespace: Telerik.WebControls
Assembly: RadGrid (in RadGrid.dll)

Syntax

Visual Basic (Declaration) 
Public ReadOnly Property SelectedItemStyle As Style
Visual Basic (Usage)Copy Code
Dim instance As GridTableView
Dim value As Style
 
value = instance.SelectedItemStyle
C# 
public Style SelectedItemStyle {get;}

Return Value

A reference to the Style object that represents the style of the selected item in a GridTableView control. If style is not altered (is default) RadGrid.SelectedItemStyle is used.

Example

The following code example demonstrates how to use the SelectedItemStyle property to define a custom style for the selected item in a GridTableView control.

[ASPX/ASCX]

<rad:RadGrid ID="RadGrid1" runat="server">
..........
<SelectedItemStyle BackColor="#FFE0C0" />
</rad:RadGrid>

Visual BasicCopy Code
RadGrid1.SelectedItemStyle.BackColor = System.Drawing.Color.Azure
C#Copy Code
RadGrid1.SelectedItemStyle.BackColor = System.Drawing.Color.Azure;
    

Remarks

Use the SelectedItemStyle property to control the appearance of the selected item in a GridTableView control. This property is read-only; however, you can set the properties of the Style object it returns. The properties can be set declaratively using one of the following methods:

  • Place an attribute in the opening tag of the GridTableView control in the form Property-Subproperty, where Subproperty is a property of the Style object (for example, SelectedItemStyle-ForeColor).
  • Nest a <SelectedRowStyle> element between the opening and closing tags of the GridTableView control.

The properties can also be set programmatically in the form Property.Subproperty (for example, SelectedItemStyle.ForeColor). Common settings usually include a custom background color, foreground color, and font properties.

Requirements

Platforms: Windows 2000, Windows XP Professional, Windows Server 2003 family

See Also