User Profile & Activity

luwen zhang Member

What is the status of this bug?

I have similar problem.  If you type "<" in a textbox column and try to save the grid , you will get an unhandled exception, "Unable to communicate with server".

 

 

Posted: November 9, 2013 9:45 AM

Hi,

The above solution did not solve the problem, so we change the route.  Yet we have the similar problem we discussed here. 

 We use the webcombo inside webdialogbox.  There are Ok and Cancel buttons in the webdialog.  After a value is selected in webcombo, you click OK button or hit enter key,  the value is saved and webdialog box is closed.  The OK button works well. But the enter key does not.  If you key in some charactors and hit enter immediately, you got this message:
"Microsoft JScript runtime error: 'rows[...].cells' is null or not an object"

I override webcombo'd onKeyDown event. Here is the code.  How to wait till the combo finish refreshing?  At least, how to catch the exception and avoid user seeing this error message? 

Thanks

function comboLookup_OnKeyDown(controlId, keyCode) {
    if (keyCode == 13) {
	var combo = ISGetObject(controlId )
	if (combo.IsDirty) {
             if (combo.Text != combo.TextObj.value) {
                 combo.HideDropDown();
             }
	}
	window.setTimeout(function () { saveClose(); }, 30);
    }
}
Posted: November 4, 2013 11:01 AM

Handy, 

I got error message:

"Microsoft JScript runtime error: Object expected" in eval code [dynamic].

it cannot find BindWebCombo set in

combo.LayoutSettings.ClientSideEvents.OnInitialize = "BindWebCombo(" + i.ToString() + ")";

 

Luwen 

 

Posted: October 25, 2013 5:49 PM

This solution does not work either. I uploaded a video.  In the video, I kept typing 123, only some of changes were caught.

https://docs.google.com/file/d/0B6PHgqLYYnxKaENXNWVOVkM1cU0/edit?usp=drive_web

 

Thanks,

Luwen

This works.  Thanks!

Posted: October 24, 2013 12:16 PM

The solution does not work. I assume it is supposed to solve my first issue.  My first issue is related to timing.  It seems the combo find the matching result record, then it does another filtering and find no match. At this time, the selected value is lost. The focus is on the combo the whole time.   My combo uses clientBinding and filtering. I override OnShowDropDown to do client side filtering.

My second issue is more urgent.  Becuse the combo is used inside a grid, I need the right and left arrow key to be able to get the selected value of combo and exit the edit mode. How to do that ? For a dropdownbox, grid.ExitEdit() can keep the selected value. For a combo,  the selected value is lost by using grid.ExitEdit(). 

 

Thanks,

Luwen

 

Posted: October 21, 2013 5:32 PM

Thanks Yudi. This works when grid does not have child table.  How to calculate the ColumnIdx when the grid uses child table?

Posted: October 11, 2013 10:54 AM

Hi Bernard,


The issue is it is very slow to use arrow keys to navigate the grid. We want a way to make it response faster. 


1. Click any cell and use arrow keys to move the cursor.  It takes long for the cursor to move to next cell.


2. Edit any cell and use arrow keys to exit the edit and move to next cell.  It takes long for the cursor to move to next cell.



I could not upload my code. Your "Attach file" button does not work.  I copy the aspx.cs code here.  you can find the aspx code in previous page.



    public partial class testb : System.Web.UI.Page
    {
        protected void Page_Load(object sender, EventArgs e)
        {
            //if (!IsPostBack) EncryptGridCols(MRUTrust);
        }
        protected void WebGrid1_BatchUpdate(object sender, BatchUpdateEventArgs e)
        {
        }
        protected void WebGrid1_Export(object sender, ISNet.WebUI.WebGrid.ExportEventArgs e)
        {
        }
        protected void WebGrid1_InitializeDataSource(object sender, ISNet.WebUI.WebGrid.DataSourceEventArgs e)
        {
            DataTable dt = new DataTable();
            dt.TableName = "TransList";
            //dt.Columns.Add(new DataColumn("Key", Type.GetType("System.Int32")));
            dt.Columns.Add(new DataColumn("PrepCount", Type.GetType("System.Int32")));
            dt.Columns.Add(new DataColumn("TranSeq", Type.GetType("System.Int32")));
            dt.Columns.Add(new DataColumn("TaxCodeTxt", Type.GetType("System.String")));
            dt.Columns.Add(new DataColumn("NumTax_Cd", Type.GetType("System.Int32")));
            dt.Columns.Add(new DataColumn("Posting_Dt", Type.GetType("System.DateTime")));
            dt.Columns.Add(new DataColumn("TaxEff_Dt", Type.GetType("System.DateTime")));
            dt.Columns.Add(new DataColumn("AssetId", Type.GetType("System.String")));
            dt.Columns.Add(new DataColumn("AssetName", Type.GetType("System.String")));
            dt.Columns.Add(new DataColumn("Explanation", Type.GetType("System.String")));
            dt.Columns.Add(new DataColumn("IncCash", Type.GetType("System.Double")));
            dt.Columns.Add(new DataColumn("PrinCash", Type.GetType("System.Double")));
            dt.Columns.Add(new DataColumn("TaxableAmt", Type.GetType("System.Double")));
            dt.Columns.Add(new DataColumn("ExDiv_Dt", Type.GetType("System.DateTime")));
            dt.Columns.Add(new DataColumn("TAVTax_Cd", Type.GetType("System.Int32")));
            dt.Columns.Add(new DataColumn("Tran_Cd", Type.GetType("System.Int32")));
            dt.Columns.Add(new DataColumn("HITReviewed_Cd", Type.GetType("System.Int32")));
            dt.Columns.Add(new DataColumn("HIT_Cd", Type.GetType("System.Int32")));
            dt.Columns.Add(new DataColumn("RecipNo", Type.GetType("System.Int32")));
            for (int i = 0; i < 2000; i++)
            {
                DataRow dr = dt.NewRow();
                dr["PrepCount"] = i;
                dr["TranSeq"] = i;
                dr["TaxCodeTxt"] = "TaxCodeTxt " + i.ToString();
                dr["NumTax_Cd"] = i % 400;
                dr["Posting_Dt"] = DateTime.Now;
                dr["TaxEff_Dt"] = DateTime.Now;
                dr["AssetId"] = "AssetId " + i.ToString();
                dr["AssetName"] = "AssetName " + i.ToString();
                dr["Explanation"] = "Explanation " + i.ToString();
                dr["IncCash"] = i;
                dr["PrinCash"] = i;
                dr["TaxableAmt"] = i;
                dr["TaxEff_Dt"] = DateTime.Now;
                dr["TAVTax_Cd"] = i % 20;
                dr["Tran_Cd"] = i % 20;
                dr["HITReviewed_Cd"] = i % 20;
                dr["HIT_Cd"] = i % 20;
                dr["RecipNo"] = i % 20;
                dt.Rows.Add(dr);
            }
            DataTable dtt = new DataTable();
            dtt.TableName = "PrepNotesList";
            dtt.Columns.Add(new DataColumn("TranSeq", Type.GetType("System.Int32")));
            dtt.Columns.Add(new DataColumn("NotePrty", Type.GetType("System.Int32")));
            dtt.Columns.Add(new DataColumn("Explanation", Type.GetType("System.String")));
            dtt.Columns.Add(new DataColumn("Added_Dt", Type.GetType("System.DateTime")));
            dtt.Columns.Add(new DataColumn("AddedIni", Type.GetType("System.String")));
            dtt.Columns.Add(new DataColumn("ChngIni", Type.GetType("System.String")));
            dtt.Columns.Add(new DataColumn("Chng_Dt", Type.GetType("System.DateTime")));
            DataSet dsParentChild = new DataSet();
            dsParentChild.Tables.Add(dt);
            dsParentChild.Tables.Add(dtt);
            DataRelation rel;
            rel = new DataRelation("relAppProps",
                dsParentChild.Tables["TransList"].Columns["TranSeq"],
                dsParentChild.Tables["PrepNotesList"].Columns["TranSeq"]);
            dsParentChild.Relations.Add(rel);
            e.DataSource = dsParentChild;  
        }
        private DataTable GetDDL(int count, string content)
        {
            DataTable dt = new DataTable();
            dt.Columns.Add(new DataColumn("Key", Type.GetType("System.Int32")));
            dt.Columns.Add(new DataColumn("Value", Type.GetType("System.String")));
            for (int i = 0; i < count; i++)
            {
                DataRow dr = dt.NewRow();
                dr["Key"] = i;
                dr["Value"] = content + " " + i.ToString();
                dt.Rows.Add(dr);
            }
            return dt;
        }
        protected void WebGrid1_InitializeLayout(object sender, ISNet.WebUI.WebGrid.LayoutEventArgs e)
        {
            try
            {
                WebValueList TaxCodeDesc = WebGrid1.RootTable.Columns.GetNamedItem("TaxCodeDesc").ValueList;
                TaxCodeDesc.DataSource = GetDDL(400, "TaxCode");
                TaxCodeDesc.DataValueField = "Key";
                TaxCodeDesc.DataTextField = "Value";
                WebValueList HitMsg = WebGrid1.RootTable.Columns.GetNamedItem("HitMsg").ValueList;
                DataTable dtHitMsg = (DataTable)HitMsg.GetCachedDataSource();
                if (dtHitMsg == null)
                {
                    dtHitMsg = GetDDL(20, "HitCd");
                }
                HitMsg.DataSource = dtHitMsg.Copy();
                HitMsg.DataValueField = "Key";
                HitMsg.DataTextField = "Value";
                WebValueList RevTranCd = WebGrid1.RootTable.Columns.GetNamedItem("TranType").ValueList;
                DataTable dtRevTranCd = (DataTable)RevTranCd.GetCachedDataSource();
                if (dtRevTranCd == null)
                {
                    dtRevTranCd = GetDDL(30, "TranType");
                }
                RevTranCd.DataSource = dtRevTranCd.Copy();
                RevTranCd.DataValueField = "Key";
                RevTranCd.DataTextField = "Value";
                WebValueList NotePrty = WebGrid1.RootTable.ChildTables[0].Columns.GetNamedItem("NotePriority").ValueList;
                DataTable dtNotePrty = (DataTable)NotePrty.GetCachedDataSource();
                if (dtNotePrty == null)
                {
                    dtNotePrty = GetDDL(10, "NotePriority");
                }
                NotePrty.DataSource = dtNotePrty.Copy();
                NotePrty.DataValueField = "Key";
                NotePrty.DataTextField = "Value";
            }
            catch (Exception ex)
            {
            }
        }
        protected void WebGrid1_InitializePostBack(object sender, PostbackEventArgs e)
        {
                    
        }
        protected void WebGrid1_InitializeRow(object sender, ISNet.WebUI.WebGrid.RowEventArgs e)
        {
        }
        protected void WebCombo1_InitializeDataSource(object sender, ISNet.WebUI.WebCombo.DataSourceEventArgs e)
        {   
            // Set the valueList for the Tax Code
            WebValueList TaxCode = WebGrid1.RootTable.Columns.GetNamedItem("TaxCode").ValueList;
            DataTable dtTaxCode = (DataTable)TaxCode.GetCachedDataSource();
            if (dtTaxCode == null)
            {
                dtTaxCode = GetDDL(400, "TaxCode");
            }
            e.DataSource = dtTaxCode.Copy();
            WebCombo1.DataValueField = "Key";
            WebCombo1.DataTextField = "Value";
        }
            
   }

 

Posted: October 10, 2013 2:56 PM

That works beautifully.  Thanks!

I saw an another issue.  When you use arrow keys to navigate the grid (with CellClickAction="CellSelect"), if the column is a webcombo or dropdownlist, your first key stoke is ignored.  While if the column is a textbox, your first key stoke is NOT ignored. How to make the first key stoke accepted as a "real" user input for webcombo and dropdownlist?


Thanks,

Luwen



Posted: October 9, 2013 11:18 AM

Thank you Hans for your quick response.

I got error message "Invalid filter expressions." when used your code.  I tried both "like" and "contains", same message.

My WebCombo version is 6.0.7200.  


Regards,

Luwen


All times are GMT -5. The time now is 4:29 PM.
Previous Next