Hi,
I've an issue with selected state of rows with custom cssclasses. I'll discribe the scenario: We have a grid with 20 addresses (name, street, city). Some records are from external source which we want to be blue (text). This works very well with cssclass, but ... After succesfully load of the girid, click on some blue record, the postback will be forced. The row is selected correctly with highlighting but after the postback is finished, the selected state is lose and is back to his normal state (rgRow or rgRowAlt).
Grid:
Databound event:
I've an issue with selected state of rows with custom cssclasses. I'll discribe the scenario: We have a grid with 20 addresses (name, street, city). Some records are from external source which we want to be blue (text). This works very well with cssclass, but ... After succesfully load of the girid, click on some blue record, the postback will be forced. The row is selected correctly with highlighting but after the postback is finished, the selected state is lose and is back to his normal state (rgRow or rgRowAlt).
Grid:
<
telerik:RadGrid
ID
=
"grdData"
Width
=
"100%"
AllowPaging
=
"True"
PageSize
=
"15"
runat
=
"server"
AllowSorting
=
"True"
GridLines
=
"None"
EnableLinqExpressions
=
"False"
GroupingEnabled
=
"False"
AutoGenerateColumns
=
"False"
CellSpacing
=
"0"
SkinID
=
"grdGeneral"
CssClass
=
"RadGrid"
>
<
ClientSettings
AllowColumnsReorder
=
"True"
ReorderColumnsOnClient
=
"True"
EnablePostBackOnRowClick
=
"true"
>
<
Selecting
AllowRowSelect
=
"True"
/>
<
Scrolling
AllowScroll
=
"True"
/>
<
Resizing
ClipCellContentOnResize
=
"true"
/>
</
ClientSettings
>
<
MasterTableView
Width
=
"100%"
ClientDataKeyNames
=
"address_ID,type_ID"
DataKeyNames
=
"address_ID,type_ID"
TableLayout
=
"Fixed"
>
<
Columns
>
<
telerik:GridBoundColumn
DataField
=
"address_ID"
UniqueName
=
"address_ID"
Visible
=
"False"
/>
<
telerik:GridBoundColumn
DataField
=
"type_ID"
UniqueName
=
"type_ID"
Visible
=
"False"
/>
<
telerik:GridTemplateColumn
UniqueName
=
"SELECT"
AllowFiltering
=
"false"
Reorderable
=
"false"
Resizable
=
"false"
>
<
ItemStyle
Width
=
"35px"
/>
<
HeaderStyle
Width
=
"35px"
/>
<
HeaderTemplate
>
<
asp:CheckBox
ID
=
"chkSelectAll"
runat
=
"server"
/>
</
HeaderTemplate
>
<
ItemTemplate
>
<
asp:CheckBox
ID
=
"chkSelect"
runat
=
"server"
/>
</
ItemTemplate
>
</
telerik:GridTemplateColumn
>
<
telerik:GridButtonColumn
ButtonType
=
"ImageButton"
UniqueName
=
"TYPE"
CommandName
=
"TYPE"
>
<
ItemStyle
Width
=
"30px"
/>
<
HeaderStyle
Width
=
"30px"
/>
</
telerik:GridButtonColumn
>
<
telerik:GridButtonColumn
ButtonType
=
"ImageButton"
ImageUrl
=
"~/images/edit.png"
UniqueName
=
"EDIT"
CommandName
=
"EDIT"
>
<
ItemStyle
Width
=
"30px"
/>
<
HeaderStyle
Width
=
"30px"
/>
</
telerik:GridButtonColumn
>
<
telerik:GridBoundColumn
DataField
=
"full_name"
UniqueName
=
"full_name"
HeaderText
=
"Naam"
>
<
ItemStyle
Wrap
=
"false"
CssClass
=
"minwidth"
/>
</
telerik:GridBoundColumn
>
<
telerik:GridBoundColumn
DataField
=
"city"
UniqueName
=
"city"
HeaderText
=
"Plaats"
>
<
ItemStyle
Width
=
"140px"
Wrap
=
"false"
/>
<
HeaderStyle
Width
=
"140px"
/>
</
telerik:GridBoundColumn
>
<
telerik:GridBoundColumn
DataField
=
"emailaddress"
UniqueName
=
"emailaddress"
HeaderText
=
"E-mailadres"
>
<
ItemStyle
Width
=
"140px"
Wrap
=
"false"
/>
<
HeaderStyle
Width
=
"140px"
/>
</
telerik:GridBoundColumn
>
<
telerik:GridBoundColumn
DataField
=
"phone"
UniqueName
=
"phone"
HeaderText
=
"Telefoon"
>
<
ItemStyle
Width
=
"140px"
Wrap
=
"false"
/>
<
HeaderStyle
Width
=
"140px"
/>
</
telerik:GridBoundColumn
>
<
telerik:GridButtonColumn
ButtonType
=
"ImageButton"
ImageUrl
=
"~/images/delete.png"
UniqueName
=
"DELETE"
CommandName
=
"DELETE"
>
<
ItemStyle
Width
=
"30px"
/>
<
HeaderStyle
Width
=
"30px"
/>
</
telerik:GridButtonColumn
>
</
Columns
>
</
MasterTableView
>
</
telerik:RadGrid
>
Databound event:
Private
Sub
grdData_ItemDataBound(
ByVal
sender
As
Object
,
ByVal
e
As
Telerik.Web.UI.GridItemEventArgs)
Handles
grdData.ItemDataBound
radItem.CssClass = IIf(radItem.ItemType = GridItemType.AlternatingItem,
"rgAltRow"
,
"rgRow"
) &
" BlueRecord"
End
Sub
.BlueRecord
{
color
:
navy
!important
;
}