Loading an XML file in Web Grid control of C1

Posted by: Victor.m.charles.civ on 5 September 2019, 7:02 am EST

  • Posted 5 September 2019, 7:02 am EST

    Hello,

    I'm moving from VB.NET to ASP.NET MVC. Can you please send me an example on how to load data from an xml file or Data table to web version of C1TrueDBGrid?

    Thanks,

    Victor
  • Replied 6 September 2019, 7:37 am EST

    Hello Alec,

    Thank you for your message, I look forward to hear from you Monday. Also is it possible to have all three Grid controls display like list boxes instead of a dropdown control?

    Kind regards,

    Victor
  • Replied 7 September 2019, 5:21 am EST

    Alec,

    Below is the code used to select all or clear data in the top two Grids, if possible to display the FlexGrid like is list box control, is the same possible with FlexGrid version? I have other capabilities in C1TrueDBGrid would like to convert to FlexGrid, but probably best to wait until case is closed..

    private void radioButton5_CheckedChanged(object sender, EventArgs e)
    {
    int i = 0;
    int count = this.C1TrueDBGrid1.Splits[0].Rows.Count;
    this.C1TrueDBGrid1.SelectedRows.Clear();
    for (i = 0; i < count; i++)
    {
    this.C1TrueDBGrid1.SelectedRows.Add(i);
    }

    }

    private void radioButton6_CheckedChanged(object sender, EventArgs e)
    {
    this.C1TrueDBGrid1.SelectedRows.Clear();
    radioButton10.Focus();
    }

    Thanks,

    Victor
  • Replied 8 September 2019, 8:57 pm EST

    Hello Victor,
    The MVC Application works differently from Windows application. It has two side Client Side and ServerSide.

    The MVC Edition control of ComponentOne can't be accessed at ServerSide. The data can be provided using the callback from Client to server.
    Also, the FlexGrid required the data in Array of JSON/objects format, it does not accepts directly XML or DataTable.
    It required to conversion the data to array of JSON/objects to show in FlexGrid.

    For showing, FlexGrid same as ListBox, if we are correct, you are looking for the implementation same as follows demo:
    https://www.grapecity.com/wijmo/demos/Grid/Selection/CheckboxSelection/purejs

    Regards,
    Manish Gupta
  • Replied 9 September 2019, 2:22 pm EST

    Hello Manish,

    I mainly need to use checkbox control, but will also need to use the FlexGrid for other features in the application.

    Is it possible to send me a sample project with a solution for both controls using JSON/objects?

    Kind regards,

    Victor
  • Replied 9 September 2019, 5:52 pm EST

    Hi Victor,
    In MVC, C1 does not have any control for Checkbox. We uses standard CheckBox through out the application.

    Please find the attached sample for reference.

    Regards,
    Manish Gupta

    FlexGrid-SelectAll-CheckBox-ColumnHeaders.zip
  • Replied 11 September 2019, 6:24 am EST

    Hi,

    When trying to run your sample project, I am receiving error message.

    LicenseException: A valid license cannot be granted for the type C1.Web.Mvc.LicenseDetector. Contact the manufacturer of the component for more information.


    On block of code beloe:

    @(Html.C1().FlexGrid().Id("grid").AutoGenerateColumns(false)
    .Bind(m => m.Bind(Model).DisableServerRead(false))
    .Columns(c =>
    {
    c.Add().Binding("Active").AllowSorting(false).AllowDragging(false).AllowMerging(false);
    c.Add().Binding("Last");
    c.Add().Binding("First");
    c.Add().Binding("Sales");
    })
    .ItemFormatter("ItemFormatter")
    .Height(500)


    How do I fix this error?

    Thanks,

    Victor:

  • Replied 11 September 2019, 6:28 pm EST

    Hi Victor,

    This might be because of the version used by C1.Web.Mvc control is compatible with C1 serial key activated on your machine.

    For e.g the shared sample used the latest build version <4.0.20192.225> which will be compatible with the Studio Enterprises or Studio Ultimate serial key purchased in 2018v2 version or after.

    Please create a SupportOne ticket for discussing the Licensing Issue:
    http://supportone.componentone.com/home

    Regards,
    Manish Gupta
Need extra support?

Upgrade your support plan and get personal unlimited phone support with our customer engagement team

Learn More

Forum Channels