Hi I have a Telerik RadGrid and I'm trying to hook up my own event to RadRating control placed inside the ItemTemplate of the grid.
The added handler does not fire..
Here is my codeBehind, what am I doing wrong?
The added handler does not fire..
<
telerik:RadGrid
ID
=
"RadGrid1"
EnableViewState
=
"False"
OnPageIndexChanged
=
"RadGrid1_PageIndexChanged"
runat
=
"server"
DataSourceID
=
"SqlDataSource1"
GridLines
=
"None"
Width
=
"850px"
Height
=
"100%"
Skin
=
"Telerik"
PageSize
=
"20"
AllowPaging
=
"True"
>
<
PagerStyle
Mode
=
"NumericPages"
PageButtonCount
=
"1"
Position
=
"TopAndBottom"
/>
<
MasterTableView
BorderStyle
=
"None"
AutoGenerateColumns
=
"False"
DataSourceID
=
"SqlDataSource1"
PageSize
=
"20"
>
<
NoRecordsTemplate
>
<
div
>
Nothing was found, start your search again. To Refresh, click <
a
href
=
"inventory.aspx?reset=no&make=clear&model=clear&yearFromGrid=clear"
>
here</
a
></
div
>
</
NoRecordsTemplate
>
<
Columns
>
<
telerik:GridBoundColumn
DataField
=
"ID"
HeaderText
=
"ID"
SortExpression
=
"ID"
UniqueName
=
"ID"
DataType
=
"System.Int32"
ReadOnly
=
"True"
Visible
=
"False"
AutoPostBackOnFilter
=
"True"
>
</
telerik:GridBoundColumn
>
</
Columns
>
<
itemTemplate
>
<
asp:UpdatePanel
runat
=
"server"
ID
=
"panel1"
>
<
ContentTemplate
>
<
telerik:RadRating
ID
=
"RadRating1"
Value
=
"3.5"
runat
=
"server"
AutoPostBack
=
"false"
Precision
=
"Exact"
/>
</
ContentTemplate
>
</
asp:UpdatePanel
>
</
ItemTemplate
>
<
EditFormSettings
>
<
FormTemplate
>
</
FormTemplate
>
</
EditFormSettings
>
<
PagerStyle
Mode
=
"NumericPages"
Position
=
"TopAndBottom"
/>
</
MasterTableView
>
<
ActiveItemStyle
BorderStyle
=
"None"
/>
</
telerik:RadGrid
>
Private
Sub
RadGrid1_ItemCreated(
ByVal
sender
As
Object
,
ByVal
e
As
Telerik.Web.UI.GridItemEventArgs)
Handles
RadGrid1.ItemCreated
If
Not
IsPostBack
Then
For
Each
gridDataItem
As
GridDataItem
In
RadGrid1.Items
Dim
radRate
As
RadRating =
DirectCast
(gridDataItem.FindControl(
"RadRating1"
), RadRating)
AddHandler
radRate.Rate,
AddressOf
CControls_UnitGrid.Rate
radRate.Value = 1
radRate.AutoPostBack =
True
Dim
panel1
As
UpdatePanel =
DirectCast
(gridDataItem.FindControl(
"panel1"
), UpdatePanel)
AddHandler
panel1.Load,
AddressOf
CControls_UnitGrid.Rate
Next
End
If
End
Sub
Shared
Sub
Rate(
ByVal
sender
As
Object
,
ByVal
e
As
EventArgs)
Dim
radRate
As
RadRating =
DirectCast
(sender, RadRating)
radRate.Value = 2
End
Sub
Here is my codeBehind, what am I doing wrong?