This is a migrated thread and some comments may be shown as answers.

Filter Grid Using ComboBox and Stored Procedure

1 Answer 60 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Richard Weeks
Top achievements
Rank 2
Richard Weeks asked on 22 Jul 2010, 07:11 AM
I've got a filtered column with a ComboBox displaying values ok, according to the example at:

http://demos.telerik.com/aspnet-ajax/grid/examples/programming/filtertemplate/defaultcs.aspx

But I'm stuck converting the filter operation to use a stored procedure instead of appending a WHERE onto a select.

The ComboBox in my RadGrid column is fed by this:

<asp:SqlDataSource 
    ID="CategoriesDataSource" 
    runat="server" 
    ConnectionString="<%$ ConnectionStrings:Development %>" 
    SelectCommand="myApp_CategoriesSelect" 
    SelectCommandType="StoredProcedure">
</asp:SqlDataSource>

What do I need to do to get this adapted? I think it has to do with adding the parameters but I'm unsure how to go about hacking up the example above to that end.

Regards,
Richard

1 Answer, 1 is accepted

Sort by
0
Schlurk
Top achievements
Rank 2
answered on 27 Jul 2010, 03:58 PM
From what I can tell all you would have to do is actually call your stored procedure to get the data, and then set this as the datasource of the MasterTableView and rebind it - that's essentially what the demo is doing with these select statements with "where" clauses, and it seems like that is the best way to approach this.
Tags
Grid
Asked by
Richard Weeks
Top achievements
Rank 2
Answers by
Schlurk
Top achievements
Rank 2
Share this question
or