User Profile & Activity

Hans Kristian Member
Page
of 69
Hello,

I have a work around / solution for your current scenario.
I made simple WebCombo sample based on your scenario.
I add two WebCombo to the sample and bind to access data source (Northwind.mdb database and Shippers table).

In the first WebCombo, I set DataTextField property to "ShipperID" & DataValueField property to "CompanyName".
In the second WebCombo, I set DataTextField property to " CompanyName " & DataValueField property to "CompanyName".

And here’s the example snippet code that I add in OnAfterItemSelected client side event:
function WebCombo1_OnAfterItemSelected(){
    var WebCombo1 = ISGetObject("WebCombo1");
    var WebCombo2 = ISGetObject("WebCombo2");
    var value = WebCombo1.Value;
    WebCombo2.SetText(value);
    WebCombo2.LoadValue();
}

Please kindly have review on my sample as well to see the result.

Thank you very much.

Regards,
Hans.

Hello,

Thank you for your question.

I made a simple WebGrid sample, bind to access data source (Northwind.mdb database & Shippers table). Then I add one html input button to “BestFit” the Phone column.
And yes, I can replicate your issue on my end as well.

To resolve this “BestFit” issue, perhaps you could use HTML5 doctype in your page & set the “RenderingMode” in WebGrid property to “HTML5”.

I attached my sample as well. Please kindly have review on my sample to see the result.
Thank you very much.

Regards,
Hans.

Hello,

Thank you for your valuable feedback.

Yes I can replicate your reported problem with my simple WebInput sample.
In this case, to get “May” value, you could you use up / down arrow keyboard.
Please kindly have review on my sample & the video to see the result.
Please let me know your response as well.

Thank you very much.

Regards,

Hans.

Hello,

I am sorry, but the developer team still considering whether this issue will be fixed or not, because of several reason.

The first consideration is like I said in my prior post. This issue occurs due to limitation of WPF itself. So perhaps we would need more time to fix this issue and we still can’t ensure the exact time when this issue will be fixed.
The second, as far I know, this scenario is very rarely applied by users. Commonly, user doesn’t showing the dropdown while window application doesn’t fully shown in the screen.

Could you inform me the urgency / deadline of your project that related with this issue?

Thank you very much.

Regards,
Hans.
Hello,

Thank you for your feedback.

So do you have resolve this “Unchecked Item” issue or not? If yes, please kindly marked one of my / your post as the answer.

Please forgive me for lack of understanding about your reply.

Thank you.

Regards,
Hans.

Hello,

Related to the “Unchecked Item” issue, after I investigate furthermore, it seems the issue occurs due to database value and data type itself.

I have tried to bind the unbound column to another table (Categories table). I set the DataValue to “CategoryID” and DataText to “CategoryName”.
The result is the “Unchecked Item” issue doesn’t occur, even without validation code that I wrote in my prior post.

It happens due to the differences between data type in RegionDescription and data type in CategoryName.
The data type of RegionDescription is “nchar” and data type of CategoryName is “nvarchar”.

As we know, ‘char’ data type is used for storing fix length character strings. ‘Char’ will add the spacebar to the blank space. Unlike the ‘varchar’ data type, it will not add the spacebar to the blank space (Char_VarChar.jpg)
However, in WebGrid’s InitializeRow server side event, we add the value text without blank space.
It will cause the “Unchecked Item” issue occur, due to the value in database and the value in WebCombo doesn’t match.

In my humble opinion, I suggest you to modify your database that using ‘char’ data type to use ‘varchar’ data type.
Because as far I know the ‘char’ data type will also cause an issue / problem, when you want to do some databases query.

I attached the modified sample that using Categories table as well.

Thank you.

Regards,
Hans.

Hello,

Thank you for reply.

Perhaps you could you use this work around to fix this issue. I add some validation code in OnItemChecked client side event. Here’s how I implement the validation code:

function Regions_WebCombo_OnItemChecked(){
    var Regions_WebCombo = ISGetObject("Regions_WebCombo");
    var Values = Regions_WebCombo.GetMultipleValues();
    var Rows = Regions_WebCombo.GetRows();
    var rowsLenght = Rows.length;
    var selectedRow = Regions_WebCombo.GetSelectedRow();
    var selectedRowValue = selectedRow.dataValue;
    var selectedRowChecked = selectedRow.childNodes[0].childNodes[0].checked;
    if (Values)
    {
        var valuesLength = Values.length;
        for (var i = 0; i < valuesLength; i++)
        {
            var valueItem = Values[i];
            if (valueItem)
            {
                if (valueItem.Value == selectedRowValue && selectedRowChecked == true)
                {
                    Values.splice(i, 1);
                }
            }
        }
    }
    Regions_WebCombo.UpdateUI();
}
function Regions_WebCombo_OnShowDropDown(controlId)
{
    var Regions_WebCombo = ISGetObject("Regions_WebCombo");
    Regions_WebCombo.LayoutSettings.ClientSideEvents.OnItemChecked = "Regions_WebCombo_OnItemChecked";
}


I have modified your sample as well. Please kindly have review on the sample to see the result.

Thank you very much.

Regards,
Hans.

Hello,

Related with my prior post about WebGrid sample, UsingWebComboNETwithMultipleSelection.aspx, I have tried to modify this sample, so this sample more similar with your current scenario.

In this sample, I set the “Bound” property in last (4th) column (Roles column) to “false”.
Then I add a couple line of code in WebGrid’s InitializeRow server side, to add/set value in Roles column.
protected void WebGrid1_InitializeRow(object sender, ISNet.WebUI.WebGrid.RowEventArgs e){
    e.Row.Cells.GetNamedItem("Roles").Value = 1;
    e.Row.Cells.GetNamedItem("Roles").Text = "Research Staff";
}

And the result is the sample work fine on my end. Please kindly have a review on this modified sample as well.

To run the sample you just simple add/attach the page/file to WebGrid sample project.

Thank you very much.

Regards,

Hans.

Hello,

Thank you very much for helping me by providing me detail information to run the sample.
Now I can run your sample on my local end.

I have a work around to achieve your scenario. I set BoundMode property in WebCombo to "ForceUnbound".
And I add this line of code in Page_Load server side event:
protected void Page_Load(object sender, EventArgs e){
    DataView view = Region_ISDataSource.Select() as DataView;
    Regions_WebCombo.PopulateUnboundData(view, true);
} 

Please have kindly have review on the modified sample to see the result.

You also can see on WebGrid sample, UsingWebComboNETwithMultipleSelection.aspx. This sample have similar scenario with your current scenario.

Thank you.

Regards,

Hans.

Hello,

Thank you for your reply.

I am really sorry, but I can’t run sample on my end, due to I don’t have your app_code file.

Would you mind to provide the sample that I can run the sample properly?
So I can help you to investigate this issue further more.

Thank you very much.

Regards,
Hans.

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