I hope this is an easy question, since I just started using Infragistics yesterday.
I created an application and put a Web Grid on a panel. I used the designer to create the data source, table and columns. The XML code, which I tweaked a little by hand, looks like this:
</igtbl:UltraWebGrid><asp:SqlDataSource ID="SqlDataSource1" runat="server" ConnectionString="<%$ ConnectionStrings:CaxcBrandsConnectionString %>"
SelectCommand="SELECT [po_num], ltrim(str(app_ord_num)) + '-' + app_ord_type csc_order, cust_name, pg_Brand, dept, store_no, start_date, end_date, sum_amt_buyer FROM [tblBrowseHdr] WHERE cust_no = 3098 and start_date > '2008.03.01'" >
</asp:SqlDataSource>
The application runs fine. However, you notice I hard-coded the cust_no and start_date. What I would like to do is to be able to control this SelectCommand in C# code, so I can put parameters there and fill them in at run time.How should I revise the application so that I can access these properties at run time?
As you will notice, I am brand new at Infragistics.
Paramaterizing the Select Command for the SqlDataSource Control is quite simple. All you need to do is add SelectParameters to the SqlDataSource Control and give these parameters values.
Click here to see how to Paramaterize your Select Command
If you want to set these values in code, follow the below article (Step 5) and it will explain how to create the parameter and then set it in code.
How to set the parameter in code. See Step 5