Hello,
I have a RadGrid that is using the Header Context filtering and I am trying to bind the list boxes, but I received this kind of error:
Compilation Error
Description: An error occurred during the compilation of a resource required to service this request. Please review the following specific error details and modify your source code appropriately.
Compilation Error Message: BC30456: 'radGrid1_FilterCheckListItemsRequested" is not a member of 'ASP.cad_cadlog_aspx'.
I'm following everything that the Telerik demo for Excel-filtering says to include, but I receive the above error regardless. I've copy/pasted what the event name is and everything. Still no luck. Here is my RadGrid code:
<
Telerik:RadGrid
ID
=
"radGrid1"
runat
=
"server"
ShowFooter
=
"true"
Width
=
"100%"
Height
=
"650px"
Visible
=
"true"
DataSourceID
=
"dsCADLog"
AllowFilteringByColumn
=
"true"
FilterType
=
"HeaderContext"
EnableHeaderContextMenu
=
"true"
EnableHeaderContextFilterMenu
=
"true"
OnFilterCheckListItemsRequested
=
"radGrid1_FilterCheckListItemsRequested"
>
5 Answers, 1 is accepted
I realize this may need some more information. So...
Here is an example of one of my columns:
<
Telerik:GridBoundColumn
DataField
=
"Project"
HeaderText
=
"Project"
SortExpression
=
"Project"
UniqueName
=
"Project"
ReadOnly
=
"true"
HeaderStyle-HorizontalAlign
=
"Center"
ItemStyle-HorizontalAlign
=
"Center"
HeaderStyle-Width
=
"5%"
FilterCheckListEnableLoadOnDemand
=
"true"
/>
And the VB code for the event in question:
Protected
Sub
rgCadLog_FilterCheckListItemsRequested(sender
As
Object
, e
As
Telerik.Web.UI.GridFilterCheckListItemsRequestedEventArgs)
Dim
dataField
As
String
= TryCast(e.Column, IGridDataColumn).GetActiveDataField()
e.ListBox.DataSource = GetDataTable(dataField)
e.ListBox.DataKeyField = dataField
e.ListBox.DataTextField = dataField
e.ListBox.DataValueField = dataField
e.ListBox.DataBind()
End
Sub
I have tried several different things for the VB event code, such as: setting the event to private, adding a handler to the event, setting the event to protected and removed aspx declaration when using handling. The listbox area looks like it shows up the way I have it currently coded (which is the code preview above), but the checklist event does not fire and when I click on the area I get an invalid viewstate JavaScript error.
I need help to resolve this as soon as possible as I have business users to answer to. Thank you.
The error indicates that there is issue connecting the event handler. And indeed, the names are different:
OnFilterCheckListItemsRequested="radGrid1_FilterCheckListItemsRequested"
While on VB code-behind it is called:
rgCadLog_FilterCheckListItemsRequested
Please make them have the same name and the issue should be resolved.
I am also sending a sample RadGrid web site to demonstrate a practical implementation.
I hope this will prove helpful.
Regards,
Eyup
Telerik by Progress
Hi Bethany,
I am attaching a simple VB page that works. Note the AutoEventWireup property in the Page directive and the Handles clauses in the .vb file.
If you keep getting the errors, I advise you copy the markup, then go to the .vb file and use the dropdowns at the top of the text editor that VS providse so you can add the handles. This will let VS update the .designer file as well, if you are using a WebApplication. Then, you can copy the rest of the code.
Regards,
Telerik by Progress