Hi,
Is is possible to reach a Filtered Template Combobox outside the event
Protected
Sub
RadGrid1_ItemCommand(
ByVal
source
As
Object
,
ByVal
e
As
Telerik.WebControls.GridCommandEventArgs)
My code for a FilterTemplate is
<
telerik:GridBoundColumn
DataField
=
"MeasuringPointName"
FilterControlAltText
=
"Filter MeasuringPointName column"
HeaderText
=
"Изм. т-ка"
SortExpression
=
"MeasuringPointName"
UniqueName
=
"MeasuringPointName"
>
<
ItemStyle
Wrap
=
"False"
/>
<
FilterTemplate
>
<
telerik:RadComboBox
ID
=
"RadComboBoxMeasuringPointName"
DataSourceID
=
"ObjectDataSourceMeasuringPointsNames"
DataTextField
=
"MeasuringPointName"
DataValueField
=
"MeasuringPointName"
AppendDataBoundItems
=
"true"
Width
=
"100%"
DropDownAutoWidth
=
"Enabled"
SelectedValue='<%# TryCast(Container,GridItem).OwnerTableView.GetColumn("MeasuringPointName").CurrentFilterValue %>'
runat="server" OnClientSelectedIndexChanged="MeasuringPointNameIndexChanged">
<
Items
>
<
telerik:RadComboBoxItem
Text
=
"Всички"
/>
</
Items
>
</
telerik:RadComboBox
>
<
telerik:RadScriptBlock
ID
=
"RadScriptBlockMeasuringPointName"
runat
=
"server"
>
<
script
type
=
"text/javascript"
>
function MeasuringPointNameIndexChanged(sender, args) {
var tableView = $find("<%# TryCast(Container,GridItem).OwnerTableView.ClientID %>");
tableView.filter("MeasuringPointName", args.get_item().get_value(), "EqualTo");
}
</
script
>
</
telerik:RadScriptBlock
>
</
FilterTemplate
>
</
telerik:GridBoundColumn
>
I have a RadComboBox and a RadButton which are used to fill SqlDataSource and invoke RadGrid.Prerender with RadGrid.Rebind(). I also use RadAjaxmanager with following code:
<
telerik:RadAjaxManager
ID
=
"RadAjaxManager1"
runat
=
"server"
DefaultLoadingPanelID
=
"RadAjaxLoadingPanel1"
>
<
AjaxSettings
>
</
telerik:AjaxSetting
>
<
telerik:AjaxSetting
AjaxControlID
=
"btnExecute"
>
<
UpdatedControls
>
<
telerik:AjaxUpdatedControl
ControlID
=
"Panel1"
/>
</
UpdatedControls
>
</
telerik:AjaxSetting
>
<
telerik:AjaxSetting
AjaxControlID
=
"MeasuringPointsDataGrid"
>
<
UpdatedControls
>
<
telerik:AjaxUpdatedControl
ControlID
=
"Panel1"
/>
</
UpdatedControls
>
</
telerik:AjaxSetting
>
</
AjaxSettings
>
<
ClientEvents
OnRequestStart
=
"onRequestStart"
/>
</
telerik:RadAjaxManager
>
<
telerik:RadAjaxLoadingPanel
ID
=
"RadAjaxLoadingPanel1"
runat
=
"server"
Skin
=
"Telerik"
Transparency
=
"30"
meta:resourcekey
=
"RadAjaxLoadingPanel1Resource1"
>
</
telerik:RadAjaxLoadingPanel
>
On first select everithing work correctly. I select item from FilterTemplate and filtering works correct. If I change the the criteria to be completed the RadGrid the FilterTemplate retains the old chosen value instead to change to "All".
My idea is to handle
btnExecute_Click(sender As Object, e As System.EventArgs) Handles btnExecute.Click
event and inside it any help would me more than welcome to set the RadComboBoxMeasuringPointName SelectedIndex to 0.
Any help would me more than welcome. Thank you.