User Profile & Activity

Yudi Member
Page
of 259
Posted: September 23, 2016 1:54 AM

Deeply apologize for the delay in sending this.

Thanks for your patience. Build 263 is now available in our nightly build server which addressed the issue. I have sent the hotfix (as attachment) to your registered email account. Please kindly check your inbox and let us know how it works in your end.

Posted: September 19, 2016 7:28 AM

Sorry for the delay in sending this.

I created a simple Crosslight (Android) project which emulate the Email validator behavior. Following steps shows the detail:

  1. open Visual Studio and select New, Project.
  2. From the dialog that appears, choose Visual C#, Intersoft Solutions, Mobile, then select Intersoft Crosslight Application (iOS, Android, Windows). Enter other necessary information such as Name, Location and Solution Name.
  3. Create a Crosslight Blank solution, by choosing Blank from the drop down and hit OK.
  4. Once the project is created, open SimpleViewModel.cs located inside the [Project Name].Core project.
  5. Locate NewText property inside the SimpleViewModel class and replace the entire code as follows:
    public string NewText
    {
        get { return _newText; }
        set
        {
            if (_newText != value)
            {
                _newText = value;
    
                const string emailRegex = @"^(?("")("".+?(?<!\\)""@)|(([0-9a-z]((\.(?!\.))|[-!#\$%&'\*\+/=\?\^`\{\}\|~\w])*)(?<=[0-9a-z])@))" +
                    @"(?(\[)(\[(\d{1,3}\.){3}\d{1,3}\])|(([0-9a-z][-\w]*[0-9a-z]*\.)+[a-z0-9][\-a-z0-9]{0,22}[a-z0-9]))$";
    
                var IsValid = (Regex.IsMatch(_newText, emailRegex, RegexOptions.IgnoreCase, TimeSpan.FromMilliseconds(250)));
    
                if (IsValid)
                    GreetingText = "Your email looks good";
                else
                    GreetingText = "Enter a valid email";
    
                OnPropertyChanged("NewText");
            }
        }
    }

    In the setter of NewText, email validation is added. The email validation uses emailRegex string constant and IsMatch method. When IsValid expression returns true, GreetingText property will be set to "Your email looks good". Else, it will be set set to "Enter a valid email".
  6. Add a folder in the [Project Name].Core project and named it as Converters.
  7. Add a class and named it as TextStyleConverter.cs into the Converters folder.
  8. Copy and replace the entire code of TextStyleConverter class as follows:
    using Intersoft.Crosslight;
    using Intersoft.Crosslight.Drawing;
    using System;
    using System.Globalization;
    
    namespace EmailValidator.Converters
    {
        public class TextStyleConverter : IValueConverter
        {
            #region IValueConverter implementation
    
            public object Convert(object value, Type targetType, object parameter, CultureInfo culture)
            {
                if (value != null)
                {
                    var styles = new StyleAttributes();
    
                    if (value.ToString() == "Your email looks good")
                        styles.ForegroundColor = Colors.Green;
                    else
                        styles.ForegroundColor = Colors.Red;
    
                    return styles;
                }
                return value;
            }
    
            public object ConvertBack(object value, Type targetType, object parameter, CultureInfo culture)
            {
                throw new NotSupportedException();
            }
    
            #endregion
        }
    }

    This converter sets ForegroundColor to green when email is valid and sets ForegroundColor to red when email is not valid.
  9. Open SimpleBindingProvider.cs located inside the [ProjectName].Core project.
  10. Add following snippet code into the constructor of SimpleBindingProvider class.
    this.AddBinding("GreetingLabel", BindableProperties.StyleAttributesProperty, new BindingDescription("GreetingText")
    {
        Converter = new TextStyleConverter()
    });

    The code adds a binding provider which acts as the mediator that provides binding definitions to the interested parties such as view models and views. The GreetingLabel is the view target contract; the BindableProperties.StyleAttributesProperty is the target property to bind; and the rest is the binding description to the converter.
  11. Save the changes and run the project.

I enclosed the simple Android project (as attachment) for your reference. Hope this helps.

Posted: September 19, 2016 2:51 AM

I recall that the Chrome rendering problem was fixed in WebUI.NET Framework 3.0. Hope this helps.

Posted: September 16, 2016 4:04 AM
Right now we have a license for the WebGrid Version 9.0.7200.1.
Do we need to purchase another license for WebGrid 10 and latest WebUI.NET Framework 3.0 or it is free.

With your current license, you should be able to get hotfix of WebUI.NET Framework 3.0. You will not be able to get hotfix of WebGrid 10 since you don't own a license of WebGrid 10.

Also can You please let us know the detailed process of upgrading the controls.

The Updating WebUI Studio page in here contains detail information (including video tutorial) which shows how you can use the Update Manager to update Intersoft Products.

Please feel free to let me know if you are having difficulties to obtain and apply hotfix using Intersoft Update Manager application. I will assist you further with the manual way.

I started my investigation by modifying BindWebValueListtoISDataSource.aspx sample file of WebGrid. The live version of this sample is in here.

The SupplierID and CategoryID column of the sample are having column edit type as DropdownList. I tested the reported problem by using following approach:

Set column's EditType to NoEdit using OnInitializeColumn server-side event.

OnInitializeColumn server-side event is invoked when WebGridColumn needs to be initialized during data binding. Following snippet code is used to set the column as read-only.

protected void WebGrid1_InitializeColumn(object sender, ColumnEventArgs e)
{
    if (e.Column.Name == "SupplierID" || e.Column.Name=="CategoryID")
    {
        e.Column.EditType = EditType.NoEdit;
    }
}

Result: column shows datatext field of dropdownlist.


Set cell's ForceNoEdit to true using OnInitializeRow server-side event.

OnInitializeRow server-side event is invoked when a WebGridRow need to initialized during data binding. Following snippet code is used to set the cell as read-only.

protected void WebGrid1_InitializeRow(object sender, ISNet.WebUI.WebGrid.RowEventArgs e)
{
    if (e.Row.Type==RowType.Record)
    {
        if (e.Row.KeyValue.ToString() == "1")
        {
            e.Row.Cells.GetNamedItem("SupplierID").ForceNoEdit = true;
            e.Row.Cells.GetNamedItem("CategoryID").ForceNoEdit = true;
        }
    }
}

Result: column shows datatext field of dropdownlist.


Set columns's EditType to NoEdit using JavaScript function.

Following snippet code is used to set the column's EditType to NoEdit.

function ToggleColumnEdit() {
    // retrieves WebGrid's object
    var grid = ISGetObject("WebGrid1");

    // access WebGrid's RootTable
    var rootTable = grid.RootTable;

    var columnSupplierID = rootTable.GetColumn("SupplierID");
    var columnCategoryID = rootTable.GetColumn("CategoryID");

    columnSupplierID.EditType = "NoEdit";
    columnCategoryID.EditType = "NoEdit";

    return true;
}

Result: column shows datatext field of dropdownlist.


Invoke SetForceNoEdit(true) of the cell using JavaScript function.

Following snippet code is used to set the cell to read-only.

function ToggleNewRowEdit() {
    // retrieves WebGrid's object
    var grid = ISGetObject("WebGrid1");

    // retrieves first row object
    var firstRow = grid.RootTable.GetRow(0);

    firstRow.GetCell("SupplierID").SetForceNoEdit(true);
    firstRow.GetCell("CategoryID").SetForceNoEdit(true);

    return true;
}

Result: column shows datatext field of dropdownlist.


I was unable to reproduce the reported problem using these techniques.

When we mark column(having column edit type as dropdownlist EditType = EditType.DropdownList;) as readonly, then datavalue field is shown.

I would need you to elaborate on your specific scenario and possibly give me a running simple sample of WebGrid and step-by-step guide that I can use to observe the problem.

Posted: September 13, 2016 2:14 AM

The reported problem(s) aren't reproducible using WebGrid 10 and latest WebUI.NET Framework 3.0. You might want to check out the live sample of WebGrid on Chrome browser.

I recommend you to try to update WebUI.NET Framework 3.0. The most recent version of WebUI.NET Framework 3.0 is 3.0.5000.975. Please use Intersoft Update Manager application to download and install the hotfix of WebUI.NET Framework 3.0.

Please let me know whether this helps or not.

Posted: September 9, 2016 3:18 AM

Sory for the delay in sending this.

Per my test, [IgnoreDataMember] attribute can be used to achieve your scenario. When applied to the member of a type, specifies that the member is not part of a data contract and is not serialized.

Hope this helps.

Posted: September 7, 2016 7:19 AM

Crosslight setup file will install the visual studio wizard in the following location: "C:\Documents and Settings\<UserName>\Documents\<Visual Studio version>\Templates\ProjectTemplates\Visual C#\Intersoft Solutions\Mobile".
Please kindly check if following files are found inside the folder:

  • CrosslightApp.zip (Crosslight project template)
  • CrosslightDomainModels.zip (Domain model template)
Posted: September 7, 2016 7:06 AM

You might want to check out the ColumnAction.aspx sample of WebGrid in here. The sample uses advanced filtering and demonstrates the column action customization by using WebContextMenu to display predefined date filters.

Hope the column action feature meets your advanced filtering requirement.

Posted: September 6, 2016 7:03 AM

I was able to reproduce the reported problem in my local end.

The problem happen because IsEditing in ViewModel doesn't change to true when the view changed into edit mode. I got the expected result if modify my command (in the ViewModel) into the following:

public void ExecuteCustomCmd(object parameter)
{
    this.IsEditing = true;
    
    // do something in here
    //this.ToastPresenter.Show("hello world");
    
    this.IsEditing = false;
}

This problem is no longer persist in the experimental assembly of Crosslight. If it's okay for you, you can try to use my approach as workaround.

Hope this helps.

All times are GMT -5. The time now is 1:23 AM.
Previous Next