asp.net - Filter GridDropDownColumn by ListTextField -
i implemented first solution in: filtering listtextfield griddropdowncolumn
my code is:
aspx
<telerik:griddropdowncolumn datasourceid="sqldatasource2" listtextfield="nm_comunidade" listvaluefield="id_comunidade" uniquename="nm_comunidade_coluna" sortexpression="nm_comunidade" headertext="comunidade" datafield="id_comunidade"dropdowncontroltype="radcombobox" footertext="" allowautomaticloadondemand="false" autopostbackonfilter="true" currentfilterfunction="startswith" allowvirtualscrolling="true" showmoreresultsbox="true" itemsperrequest="10" filtercontrolwidth="100%" showfiltericon="false" columneditorid="nm_comunidade_editor"> </telerik:griddropdowncolumn> <telerik:gridboundcolumn datafield="nm_comunidade" headertext="nm_comunidade" sortexpression="nm_comunidade" uniquename="nm_comunidade" display="false" readonly="true"></telerik:gridboundcolumn> c#
protected void gridcultos_itemcommand(object source, gridcommandeventargs e) { if (e.commandname == radgrid.filtercommandname) { pair command = (pair)e.commandargument; if (command.second.tostring() == "nm_comunidade_coluna") { e.canceled = true; gridfilteringitem filter = (gridfilteringitem)e.item; ((filter["nm_comunidade"].controls[0]) textbox).text = ((filter["nm_comunidade_coluna"].controls[0]) textbox).text; command.second = "nm_comunidade"; filter.firecommandevent("filter", new pair(command.first, "nm_comunidade")); } } } protected void gridcultos_itemdatabound(object sender, griditemeventargs e) { if (e.item gridfilteringitem) { gridfilteringitem item = e.item gridfilteringitem; ((item["nm_comunidade_coluna"].controls[0]) textbox).text = ((item["nm_comunidade"].controls[0]) textbox).text; } } the filter working first time filter function "startswith" , after seems changing filter function "equalto".
the problem in aspx:
<telerik:griddropdowncolumn uniquename="categoryddcolumn" listtextfield="employeeid" headertext="category name" listvaluefield="orderid" datafield="orderid" datasourceid="sqldatasource1" allowvirtualscrolling="true" showmoreresultsbox="true" datatype="system.string" itemsperrequest="10" filtercontrolwidth="100%" showfiltericon="false" footertext="" allowautomaticloadondemand="false" autopostbackonfilter="true"> </telerik:griddropdowncolumn> <telerik:gridboundcolumn datafield="employeeid" uniquename="employeeid" display="false"> </telerik:gridboundcolumn> the solution setting datatype="system.string" griddropdowncolumn , removing currentfilterfunction="startswith". filter work filter function "contains", ok.
Comments
Post a Comment