I have, what I hope to be a quick and easy question regarding filtering records using the SelectParameters of the LLBLGenProDataSource2.
Before I ask, I should mention that we are using LLBLGen Pro 2.0.0.0 Final (Oct 3rd, 2006) with .Net 2.x and Sitefinity 3.2.
So, I have a GridView on my page that has it's datasource set to the Id of the LLBLGenProDataSource2. When I run it as is, all of the records are returned, and I'm able to sort and page. So far, so good.
Now I'm trying to add a filter to the grid so that I can show only records that contain the text that's provided (using a LIKE). There's also a couple of dropdown lists that I also want to use to filter, but for now I only have the textbox.
I've added a SelectParameter to the LLBLGenProDataSource2, set its controlId to the Id of the textbox, the defaultvalue is set to '', the name is set to "title" and the propertyname is "Text". Also, currently I removed the livepersistence attribute (it was previously in there, set to true).
So what I'm wondering is, if I place a button on my form, what do I need to do to get the button to tell the LLBLGenProDataSource2 to re-get the data, and filter it by what's in the textbox? I've looked in the helpfile ("[b]Generated code - Databinding with ASP.NET 2.0, Adapter[/b]"), but either I couldn't find what I needed, or just don't understand the help file.
I've even set the text of the textbox to something and ran the application, but all of the records are still returned.
Is there something in the code behind that I should be doing? In the Button's click eevnt, should I be telling the GridView to DataBind()? I've tried this, but this doesn't seem to work either.
Here's the markup that I have so far:
<llblgenpro:llblgenprodatasource2 id="LLBLGenProDataSource2_1" runat="server" adaptertypename="SMDHU.Website.Module.Parenting.LLBL.DatabaseSpecific.DataAccessAdapter, SMDHU.Website.Module.Parenting.LLBLDBSpecific" datacontainertype="EntityCollection" entityfactorytypename="SMDHU.Website.Module.Parenting.LLBL.FactoryClasses.ParentingPagesSearchEntityFactory, SMDHU.Website.Module.Parenting.LLBL" enablepaging="True">
<selectparameters>
<asp:controlparameter controlid="txtParentingPageTitle" defaultvalue="''" name="title" propertyname="Text" />
</selectparameters>
</llblgenpro:llblgenprodatasource2>
<telerik:radgrid id="grdPages" datasourceid="LLBLGenProDataSource2_1" allowpaging="true" allowsorting="true" runat="server">
<pagerstyle mode="NextPrevNumericAndAdvanced" nextpagetext="&gt;" PrevPageText="&lt;" AlwaysVisible="true" />
<clientsettings enablepostbackonrowclick="false">
<selecting allowrowselect="false" />
</clientsettings>
<mastertableview headerstyle-backcolor="#2C6FD1" allowsorting="true" datakeynames="PageId" commanditemdisplay="None" headerstyle-height="10px" visible="true" autogeneratecolumns="false">
<columns>
<telerik:gridbuttoncolumn buttontype="LinkButton" commandname="Select" text="Edit" headerstyle-width="25" headertext="" />
<telerik:gridboundcolumn datafield="Title" headertext="Title" />
</columns>
</mastertableview>
</telerik:radgrid>
Any help in the right direction would be greatly appreciated.
Thanks,
Carl J
http://www.carlj.ca