User Profile & Activity

Yudi Member
Page
of 259
Posted: December 15, 2016 8:12 AM

... I managed to do filtering in the same way as in your example ...

Glad to hear the good news.

Should you need further assistance or run into any problems regarding our controls, feel free to contact us through the live chat service or post it into our community. We would be happy to assist you again.

Do we have any update on the above ticket?

Sorry for the delay in sending this.

The ExportAllData will not work if VirtualLoadMode is set to Custom or LargeData. For such scenario, you might want to try this approach: re-creating the table that will be exported by utilizing OnExport server-side event of WebGrid.

WebGrid has OnExport server-side event which allows you to use your own exporting codes or module to handle exporting functionality.

I managed to export all data by modifying WebGridRowCollection such as shown in the following snippet code (please note that following snippet code works for WebGrid's data binding performed at OnInitializeDataSource event):

protected void WebGrid1_Export1(object sender, ExportEventArgs e)
{
    e.Table.Rows.Clear();

    DataRowCollection rows = (e.DataSource as System.Data.DataView).ToTable().Rows;

    foreach (DataRow row in rows)
    {
        var wgRow = e.Table.CreateRow();

        foreach (WebGridColumn col in e.Table.Columns)
        {
            if (!col.IsRowChecker)
            {
                wgRow.Cells.GetNamedItem(col.Name).Value = row[col.DataMember];
                wgRow.Cells.GetNamedItem(col.Name).Text = wgRow.Cells.GetNamedItem(col.Name).Value.ToString();
            }
        }

        e.Table.Rows.Add(wgRow);
    }
}

Please give it a spin and let us know how it works in your end.

The ExportAllData will not work if VirtualLoadMode is set to Custom or LargeData. For such scenario, you might want to try this approach: re-creating the table that will be exported by utilizing OnExport server-side event of WebGrid.

WebGrid has OnExport server-side event which allows you to use your own exporting codes or module to handle exporting functionality.

I managed to export all data by modifying WebGridRowCollection such as shown in the following snippet code (please note that following snippet code works for WebGrid's data binding performed at OnInitializeDataSource event):

protected void WebGrid1_Export1(object sender, ExportEventArgs e)
{
    e.Table.Rows.Clear();

    DataRowCollection rows = (e.DataSource as System.Data.DataView).ToTable().Rows;

    foreach (DataRow row in rows)
    {
        var wgRow = e.Table.CreateRow();

        foreach (WebGridColumn col in e.Table.Columns)
        {
            if (!col.IsRowChecker)
            {
                wgRow.Cells.GetNamedItem(col.Name).Value = row[col.DataMember];
                wgRow.Cells.GetNamedItem(col.Name).Text = wgRow.Cells.GetNamedItem(col.Name).Value.ToString();
            }
        }

        e.Table.Rows.Add(wgRow);
    }
}

Please give it a spin and let us know how it works in your end.

Posted: December 15, 2016 7:42 AM

Please find LicenseManager.zip in the attachment and carefully perform following steps:

  1. Download and extract LicenseManager.zip
  2. Find ISNet.WebUI.LicenseManager.exe file inside the LicenseManager folder of the extracted LicenseManager.zip
  3. Copy ISNet.WebUI.LicenseManager.exe (from previous step) into following path: "[Intersoft Solutions installation folder]\WebUI Studio for ASP.NET\WebUI.NET Framework 3.0\LicenseManager\ISNet.WebUI.LicenseManager.exe"
  4. Run LicenseManager.exe
  5. Delete currently registered licenses.
  6. Re-register the license using the new Intersoft License Manager 3.1.

Please give it a spin and let us know how it works in your end.

Try to replace WebGrid1.DataSourceManager.CurrentDataSource with e.DataSource. The OnExport event-handler will look like following after changes:

protected void WebGrid1_Export1(object sender, ExportEventArgs e)
{
    e.Table.Rows.Clear();

    DataRowCollection rows = (e.DataSource as System.Data.DataView).ToTable().Rows;

    foreach (DataRow row in rows)
    {
        var wgRow = e.Table.CreateRow();

        foreach (WebGridColumn col in e.Table.Columns)
        {
            if (!col.IsRowChecker)
            {
                wgRow.Cells.GetNamedItem(col.Name).Value = row[col.DataMember];
                wgRow.Cells.GetNamedItem(col.Name).Text = wgRow.Cells.GetNamedItem(col.Name).Value.ToString();
            }
        }

        e.Table.Rows.Add(wgRow);
    }
}

Hope this helps.

Posted: November 25, 2016 7:32 AM

I created a sample of WebCombo with following specification:

  • Multiple selection enabled.
  • Checkbox element is added to the page. On checkbox click, additional filter is added to the WebCombo by using following snippet code:
    customersCombo.SetAdditionalFilters("[Country] = 'Germany'");

Please find the attached sample and let me know whether this helps or not.

Posted: November 25, 2016 5:04 AM

Thank you for the sample (WebgridBrowserCompTesting.zip).

Please find my simple sample created based on WebgridBrowserCompTesting (aspx and aspx.cs file from WebgridBrowserCompTesting.zip). Per my test, WebGrid works without problem on Firefox 50.0 and Chrome 54.0 browser.

Should you have different result, please feel free to let me know.

... return resized webgrid columns so it could be save and used to fix the width when user return to that page next time...

WebGrid has SaveTablesStructureToXml() method which allows you to save RootTable properties – including its Columns and ChildTables – along with all objects contained to an XML file. The table structure can be applied to WebGrid by using LoadTablesStructureFromXml method. The method will loads table file structure from an XML file and restore it to RootTable of WebGrid.

The snippet code below shows how to save and restore WebGrid's table structure to/from XML file.

protected void Button1_Click(object sender, EventArgs e)
{
	WebGrid1.SaveTablesStructureToXml(Server.MapPath("WebGridTableStructure.xml"));
}

protected void Button1_Click(object sender, EventArgs e)
{
	WebGrid1.LoadTablesStructureFromXml(Server.MapPath("WebGridTableStructure.xml"));
}

Alternatively, you can save the structure to memorystream by invoking SaveTablesStructure() method.

protected void Button1_Click(object sender, EventArgs e)
{
    MemoryStream ms = new MemoryStream();
    WebGrid1.SaveTablesStructure(ms);

    Session["wgState"] = ms;
}

Then load it by invoking LoadTablesStructure() method.

protected void Button2_Click(object sender, EventArgs e)
{
    // retrieve the saved state
		object state = Session["wgState"];
        if (state != null)
        {
            MemoryStream ms = (MemoryStream)state;
            ms.Seek(0, SeekOrigin.Begin);
            WebGrid1.LoadTablesStructure(ms);
            WebGrid1.RebindDataSource();
        }
}

Hope this helps.

Posted: November 7, 2016 6:20 AM

How can I do this form codebehind or from markup?

In order to register SmartWebResources, please carefully follow the steps below:

  1. Drag one of the 2007 control to the design surface. For instance, WebGrid.
  2. Right click on the control, choose Register SmartWebResources from the context menu. See following screenshot:

Please note: You only need to perform this instruction once throughout development for the specific web application.

If you still have difficulties to register SmartWebResources, please feel free to let us know.

Posted: November 7, 2016 5:46 AM

Could you please try to add the ScriptService attribute for the WebService1 class (in WebService1.asmx.cs)? Following snippet code shows how:

/// <summary>/// Summary description for WebService1/// </summary>
[WebService(Namespace = "http://tempuri.org/")]
[WebServiceBinding(ConformsTo = WsiProfiles.BasicProfile1_1)]
[System.ComponentModel.ToolboxItem(false)]
// To allow this Web Service to be called from script, using ASP.NET AJAX, uncomment the following line. 
[System.Web.Script.Services.ScriptService]
public class WebService1 : System.Web.Services.WebService
{
	[WebMethod]
	public List<Item> GetItemList()
	{
		...
	}
}


but for some reason webcombo only shows loading

I suspect that WebCombo keep showing loading indicator because the WebService method is not allowed to be called. Adding the ScriptService attribute for the WebService1 class should resolve the problem.

If the problem still persist, please feel free to let me know.

and onvalue change server event (OnValueChanged) need to fire to handle

OnValueChanged event handler is not fired when WebCombo is bind to WebService. For more detail, please kindly check "The Differences with Server Data Binding" section in WebCombo online documentation.

To achieve the same post-processing in client binding mode, handle the OnAfterItemSelected client-side event.

Hope this helps.

Webcombo need to support autocomplete also.

Auto complete entry mode works on WebCombo with client-binding (to WebService) enabled. Check out how the feature works on the Country WebCombo in this live sample page of WebCombo.

All times are GMT -5. The time now is 7:32 PM.
Previous Next