﻿<?xml version="1.0" encoding="utf-8"?><rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:wfw="http://wellformedweb.org/CommentAPI/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:sy="http://purl.org/rss/1.0/modules/syndication/" xmlns:media="http://search.yahoo.com/mrss/" xmlns:feedburner="http://rssnamespace.org/feedburner/ext/1.0" version="2.0"><channel><title>Intersoft Community - WebGrid Enterprise - Reload webgrid data by Changing the WebCombo </title><link>http://www.intersoftsolutions.com/Community/WebGrid/Reload-webgrid-data-by-Changing-the-WebCombo/</link><description /><generator>http://www.intersoftsolutions.com</generator><language>en</language><copyright>Copyright 2002 - 2015 Intersoft Solutions Corp. All rights reserved.</copyright><ttl>60</ttl><item><title>Reload webgrid data by Changing the WebCombo </title><link>http://www.intersoftsolutions.com/Community/WebGrid/Reload-webgrid-data-by-Changing-the-WebCombo/</link><pubDate>Sun, 28 Jul 2013 21:04:52 GMT</pubDate><dc:creator>yudi</dc:creator><description>&lt;p&gt;&lt;span style="color: rgb(31, 73, 125);"&gt;Glad to hear the good news.&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span style="color: rgb(31, 73, 125);"&gt;Should you need further assistance or run into any problems regarding our controls, feel free to post it into our forum. We would be happy to assist you again.&lt;/span&gt;&lt;/p&gt;</description></item><item><title>Reload webgrid data by Changing the WebCombo </title><link>http://www.intersoftsolutions.com/Community/WebGrid/Reload-webgrid-data-by-Changing-the-WebCombo/</link><pubDate>Fri, 26 Jul 2013 00:22:04 GMT</pubDate><dc:creator>yogoo</dc:creator><description>&lt;p&gt;Yudi,&lt;/p&gt;
&lt;p&gt;     Thank you so much for your help, the code is working prefectly fine. &lt;/p&gt;
&lt;p&gt; &lt;/p&gt;
&lt;p&gt;Don.,&lt;/p&gt;</description></item><item><title>Reload webgrid data by Changing the WebCombo </title><link>http://www.intersoftsolutions.com/Community/WebGrid/Reload-webgrid-data-by-Changing-the-WebCombo/</link><pubDate>Thu, 25 Jul 2013 02:45:00 GMT</pubDate><dc:creator>yudi</dc:creator><description>&lt;blockquote&gt;...&lt;p&gt;But is it possible that to use the same method and only pass the value of the combo value to that method and update the grid?&lt;/p&gt;
&lt;p&gt;E.g. The grid is a infomation of Students and the combo is a list of Class. If i select a Class, the grid will show the studend that belong to that Class.&lt;/p&gt;
...&lt;/blockquote&gt;
&lt;p&gt;&lt;span style="color: rgb(31, 73, 125);"&gt;Yes, it is possible to use the same method and pass a value to that method and update the grid.&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span style="color: rgb(31, 73, 125);"&gt;In order to do this, please set the &lt;strong&gt;SelectMethod&lt;/strong&gt; property of WebGrid to the desired WebMethod, for example: GetStudents.&lt;/span&gt;&lt;/p&gt;&lt;pre&gt;&amp;lt;ISWebGrid:WebGrid ID="WebGrid1" runat="server"
    BindingOperationMode="ClientBinding" ...&amp;gt;
    ...
    &amp;lt;ClientBindingSettings DataSourceType="WebService"
        ServiceUrl="../WebService.asmx"
        ItemTypeName="Students"&amp;gt;
        &amp;lt;ServiceMethods SelectMethod="GetStudents" /&amp;gt;
    &amp;lt;/ClientBindingSettings&amp;gt;
&amp;lt;/ISWebGrid:WebGrid&amp;gt;&lt;/pre&gt;
&lt;p&gt;&lt;span style="color: rgb(31, 73, 125);"&gt;The &lt;strong&gt;GetStudents&lt;/strong&gt; WebMethod should be defined like following snippet code so that we can pass select argument into it.&lt;/span&gt;&lt;/p&gt;&lt;pre&gt;[WebMethod]
public object GetStudents(DataSourceSelectArguments selectArguments)
{
    if (selectArguments.Tag == "condition1")
    {
        // returns list of students based on condition1
    }
    else if (selectArguments.Tag == "condition2")
    {
        // returns list of students based on condition2
    }
}&lt;/pre&gt;
&lt;p&gt;&lt;span style="color: rgb(31, 73, 125);"&gt;&lt;strong&gt;DataSourceSelectArguments&lt;/strong&gt; class contains the following properties:&lt;/span&gt;&lt;/p&gt;
&lt;ul style="color: rgb(31, 73, 125);"&gt;&lt;li&gt;&lt;strong&gt;FilterExpression&lt;/strong&gt;. &lt;em&gt; The string of filter expression based on ADO.NET syntax.&lt;/em&gt;&lt;/li&gt;&lt;li&gt;&lt;strong&gt;SortExpression&lt;/strong&gt;. &lt;em&gt;The string of sort expression based on ADO.NET syntax.&lt;/em&gt;&lt;/li&gt;&lt;li&gt;&lt;strong&gt;MaximumRows&lt;/strong&gt;. &lt;em&gt;The number of maximum rows to be retrieved.&lt;/em&gt;&lt;/li&gt;&lt;li&gt;&lt;strong&gt;OperationType&lt;/strong&gt;. &lt;em&gt;The type of the operation for this request.&lt;/em&gt;&lt;/li&gt;&lt;li&gt;&lt;strong&gt;StartRowIndex&lt;/strong&gt;. &lt;em&gt;The start index of the row to be retrieved.&lt;/em&gt;&lt;/li&gt;&lt;li&gt;&lt;strong&gt;ViewName&lt;/strong&gt;. &lt;em&gt;The view name or table name to be selected.&lt;/em&gt;&lt;/li&gt;&lt;li&gt;&lt;strong&gt;RetrieveTotalCount&lt;/strong&gt;. &lt;em&gt;Specifies whether the results should include total count of the query.&lt;/em&gt;&lt;/li&gt;&lt;li&gt;&lt;strong&gt;Tag&lt;/strong&gt;. &lt;em&gt;Custom information passed from client-side.&lt;/em&gt;&lt;/li&gt;&lt;/ul&gt;
&lt;p&gt;&lt;span style="color: rgb(31, 73, 125);"&gt;The &lt;em&gt;Tag&lt;/em&gt; property is suitable for use in such scenario. Next, add following JavaScript function in the client-side to be used in &lt;strong&gt;ServiceEvents&lt;/strong&gt;.&lt;/span&gt;&lt;/p&gt;
&lt;pre&gt;function Service_Selecting(control, selectArguments)
{
    ...
    selectArguments.Tag = "condition1";
    ...
}&lt;/pre&gt;
&lt;p&gt;&lt;span style="color: rgb(31, 73, 125);"&gt;Note: &lt;strong&gt;Service_Selecting&lt;/strong&gt; function is used in &lt;strong&gt;Selecting&lt;/strong&gt; event. The &lt;em&gt;Selecting&lt;/em&gt; event is invoked when the data provider is about to perform data selection.&lt;/span&gt;&lt;/p&gt;
&lt;pre&gt;&amp;lt;ISWebGrid:WebGrid ID="WebGrid1" runat="server"
    BindingOperationMode="ClientBinding" ...&amp;gt;
    ...
    &amp;lt;ClientBindingSettings DataSourceType="WebService"
        ServiceUrl="../WebService.asmx"
        ItemTypeName="Students"&amp;gt;
        &amp;lt;ServiceMethods SelectMethod="GetStudents" /&amp;gt;
        &amp;lt;ServiceEvents Selecting="Service_Selecting" /&amp;gt;
    &amp;lt;/ClientBindingSettings&amp;gt;
&amp;lt;/ISWebGrid:WebGrid&amp;gt;&lt;/pre&gt;
&lt;p&gt;&lt;span style="color: rgb(31, 73, 125);"&gt;Hope this helps.&lt;/span&gt;&lt;/p&gt;</description></item><item><title>Reload webgrid data by Changing the WebCombo </title><link>http://www.intersoftsolutions.com/Community/WebGrid/Reload-webgrid-data-by-Changing-the-WebCombo/</link><pubDate>Wed, 24 Jul 2013 04:52:15 GMT</pubDate><dc:creator>yogoo</dc:creator><description>&lt;p&gt;Thanks you sample.&lt;/p&gt;
&lt;p&gt;In you sample, the grid web method will be changed according to the combo value.&lt;/p&gt;
&lt;p&gt;But is it possible that to use the same method and only pass the value of the combo value to that method and update the grid?&lt;/p&gt;
&lt;p&gt;E.g. The grid is a infomation of Students and the combo is a list of Class. If i select a Class, the grid will show the studend that belong to that Class.&lt;/p&gt;
&lt;p&gt; &lt;/p&gt;
&lt;p&gt;Thanks a lot.&lt;/p&gt;</description></item><item><title>Reload webgrid data by Changing the WebCombo </title><link>http://www.intersoftsolutions.com/Community/WebGrid/Reload-webgrid-data-by-Changing-the-WebCombo/</link><pubDate>Wed, 24 Jul 2013 04:51:44 GMT</pubDate><dc:creator>yogoo</dc:creator><description>&lt;p&gt;Thanks you sample.&lt;/p&gt;
&lt;p&gt;In you sample, the grid web method will be changed according to the combo value.&lt;/p&gt;
&lt;p&gt;But is it possible that to use the same method and only pass the value of the combo value to that method and update the grid?&lt;/p&gt;
&lt;p&gt;E.g. The grid is a infomation of Students and the combo is a list of Class. If i select a Class, the grid will show the studend that belong to that Class.&lt;/p&gt;
&lt;p&gt; &lt;/p&gt;
&lt;p&gt;Thanks a lot.&lt;/p&gt;</description></item><item><title>Reload webgrid data by Changing the WebCombo </title><link>http://www.intersoftsolutions.com/Community/WebGrid/Reload-webgrid-data-by-Changing-the-WebCombo/</link><pubDate>Wed, 24 Jul 2013 04:07:21 GMT</pubDate><dc:creator>yudi@intersoftpt.com</dc:creator><description>&lt;p&gt;&lt;span style="color: rgb(31, 73, 125);"&gt;I have re-uploaded the sample in this post. Please feel free to let us know if you still have problems to download the sample.&lt;/span&gt;&lt;/p&gt;</description></item><item><title>Reload webgrid data by Changing the WebCombo </title><link>http://www.intersoftsolutions.com/Community/WebGrid/Reload-webgrid-data-by-Changing-the-WebCombo/</link><pubDate>Wed, 24 Jul 2013 03:49:23 GMT</pubDate><dc:creator>yogoo</dc:creator><description>&lt;p&gt;Thank you so much for your reply, but why i can't download the sample? is it the problem of my browser?&lt;/p&gt;</description></item><item><title>Reload webgrid data by Changing the WebCombo </title><link>http://www.intersoftsolutions.com/Community/WebGrid/Reload-webgrid-data-by-Changing-the-WebCombo/</link><pubDate>Wed, 24 Jul 2013 03:10:52 GMT</pubDate><dc:creator>yudi</dc:creator><description>&lt;p&gt;&lt;span style="color: rgb(31, 73, 125);"&gt;I created a simple sample of WebGrid which will change WebGrid’s data by selecting a table name from an ASP.NET DropDownList control. The grid is bound to a WebService.&lt;/span&gt;&lt;/p&gt;
&lt;/dt&gt;&lt;dd&gt;Sample's screenshot&lt;/dd&gt;&lt;/dl&gt;&lt;/div&gt;
&lt;p&gt;&lt;span style="color: rgb(31, 73, 125);"&gt;Initially, WebGrid will shows Customers data. When selected index of DropDownList get changed, set the &lt;em&gt;ItemTypeName&lt;/em&gt; and &lt;em&gt;SelectMethod&lt;/em&gt; based on the selected value of DropDownList. And last, invokes the LoadTablesStructureFromXml(string fileName) method to load the desired table structure and restore it to RootTable object of current WebGrid.&lt;/span&gt;&lt;/p&gt;&lt;pre&gt;protected void DropDownList1_SelectedIndexChanged(object sender, EventArgs e)
{
    string tblName = DropDownList1.SelectedValue.ToString();
        
    if (tblName != null &amp;amp;&amp;amp; tblName != "")
    {
        WebGrid1.ClientBindingSettings.ItemTypeName = tblName;
        WebGrid1.ClientBindingSettings.ServiceMethods.SelectMethod = "Get" &amp;#43; tblName;
        WebGrid1.LoadTablesStructureFromXml(Server.MapPath(tblName &amp;#43; ".xml"));
    }
}&lt;/pre&gt;
&lt;p&gt;&lt;span style="color: rgb(31, 73, 125);"&gt;For more detail, please check the aspx page and the aspx.cs file of the sample.&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span style="color: rgb(31, 73, 125);"&gt;I enclosed the sample as attachment. Please have the attached sample evaluated on your end and let us hear whether it helps or not.&lt;/span&gt;&lt;/p&gt;
</description></item><item><title>Reload webgrid data by Changing the WebCombo </title><link>http://www.intersoftsolutions.com/Community/WebGrid/Reload-webgrid-data-by-Changing-the-WebCombo/</link><pubDate>Tue, 23 Jul 2013 00:16:22 GMT</pubDate><dc:creator>yogoo</dc:creator><description>&lt;p&gt;Hi, &lt;/p&gt;
&lt;p&gt;     Do you  have any sample code which can demo how the webgrid data reload according the webcombo selection. And the grid is binding with a webservices.&lt;/p&gt;
&lt;p&gt;Thanks,&lt;/p&gt;
&lt;p&gt; &lt;/p&gt;
&lt;p&gt;Don.,&lt;/p&gt;</description></item></channel></rss>