﻿<?xml version="1.0" encoding="utf-8"?><rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:wfw="http://wellformedweb.org/CommentAPI/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:sy="http://purl.org/rss/1.0/modules/syndication/" xmlns:media="http://search.yahoo.com/mrss/" xmlns:feedburner="http://rssnamespace.org/feedburner/ext/1.0" version="2.0"><channel><title>Intersoft Community - Lounge - webgrid events dropdownlist change</title><link>http://www.intersoftsolutions.com/Community/Lounge/webgrid-events-dropdownlist-change/</link><description /><generator>http://www.intersoftsolutions.com</generator><language>en</language><copyright>Copyright 2002 - 2015 Intersoft Solutions Corp. All rights reserved.</copyright><ttl>60</ttl><item><title>webgrid events dropdownlist change</title><link>http://www.intersoftsolutions.com/Community/Lounge/webgrid-events-dropdownlist-change/</link><pubDate>Mon, 12 Aug 2013 02:57:27 GMT</pubDate><dc:creator>Hans</dc:creator><category>webgrid events dropdownlist change</category><description>Hello,&lt;br /&gt;&lt;br /&gt;Thank you for your question regarding WebGrid control.&lt;br /&gt;&lt;br /&gt;Q: “I use onAfterExitEditMode but if i press tab botton the cursor goes to the first editable cell set from the previous value choose in dropdownlist and not in the new.”&lt;br /&gt;A: By default, in edit phase in the existing row, if you press tab key until the last column, it will go down to the next row in first column.&lt;br /&gt;If you are in add new row phase, if you press tab key until the last column, it will add the row automatically.&lt;br /&gt;That is the WebGrid’s default behavior.&lt;br /&gt;&lt;br /&gt;Please forgive me for lack of understanding about the reported problem and please let me know your response.&lt;br /&gt;&lt;br /&gt;Thank you.&lt;br /&gt;&lt;br /&gt;Regards,&lt;br /&gt;Hans.</description></item><item><title>webgrid events dropdownlist change</title><link>http://www.intersoftsolutions.com/Community/Lounge/webgrid-events-dropdownlist-change/</link><pubDate>Wed, 07 Aug 2013 12:43:18 GMT</pubDate><dc:creator>ptripolisi@gmail.com</dc:creator><category>webgrid events dropdownlist change</category><description>&lt;p&gt;Hi,&lt;/p&gt;&lt;p&gt;I need to set editable/not editable some cells(NUM_SCAGL,COD_UNIONE,TP_CLIENTE, NUM_PUNTI,SCNT_VAL&lt;span style="font-size: 10pt;"&gt;) after the change value of a cell set as a dropdown list (&lt;/span&gt;Tipologia--&amp;gt;TIPL_DE&lt;span style="font-size: 10pt;"&gt;).&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;I use onAfterExitEditMode but if i press tab botton the cursor goes to the first editable cell set from the previous value choose in dropdownlist and not in the new.&lt;/p&gt;
&lt;p&gt;How can i solve this problem?&lt;/p&gt;
&lt;p&gt;&lt;br /&gt;&lt;/p&gt;
&lt;p&gt;Bye,&lt;/p&gt;
&lt;p&gt;Paola&lt;/p&gt;
&lt;p&gt;&lt;br /&gt;&lt;/p&gt;&lt;pre&gt;DROPDOWNLIST:
if (headerGroup.childNodes[0].childNodes[0].childNodes[0].childNodes[i].innerText.match("Tipologia") == "Tipologia") {
            headerGroup.childNodes[0].childNodes[0].childNodes[0].childNodes[i].childNodes[0].innerHTML =
                    "Tipologia &amp;lt;input id=\"btnColGroupTipl\" class=\"btnColGroup\" type=\"button\" value=\"" &amp;#43; value &amp;#43; "\" onclick=\"javascript:btnColGroupClickTipl()\" /&amp;gt;";
            grid.RootTable.UpdateUI();
        }
WEBGRID:
&amp;lt;ISWebGrid:WebGridColumn Caption="Tipologia" DataMember="TIPL_DE" Name="TIPL_DE"
                                AllowMultiLine="true" Width="80px" EditType= "DropdownList" FilterEditType="TextBox"&amp;gt;                                
                                &amp;lt;CellStyle CssClass="columnTextDisabled"&amp;gt;
                                &amp;lt;/CellStyle&amp;gt;
                            &amp;lt;/ISWebGrid:WebGridColumn&amp;gt;
                                                                              
                            &amp;lt;ISWebGrid:WebGridColumn Caption="Scaglione" DataMember="NUM_SCAGL" Name="NUM_SCAGL" AllowMultiLine="true"
                                Width="1px" FilterEditType="TextBox" EditType="DropdownList" &amp;gt;
                                &amp;lt;CellStyle CssClass="columnDisabled"&amp;gt;
                                &amp;lt;/CellStyle&amp;gt;
                            &amp;lt;/ISWebGrid:WebGridColumn&amp;gt; 
                            &amp;lt;ISWebGrid:WebGridColumn Caption="Codice unione" DataMember="COD_UNIONE" Name="COD_UNIONE" AllowMultiLine="true"
                                Width="1px" FilterEditType="TextBox" TextboxMaxlength=3&amp;gt;
                                &amp;lt;CellStyle CssClass="columnDisabled"&amp;gt;
                                &amp;lt;/CellStyle&amp;gt;
                            &amp;lt;/ISWebGrid:WebGridColumn&amp;gt;
                            &amp;lt;ISWebGrid:WebGridColumn Caption="Tipo cliente" DataMember="TP_CLIENTE" Name="TP_CLIENTE"
                                EditType="DropdownList" AllowMultiLine="true" Width="1px" FilterEditType="TextBox"&amp;gt;
                                &amp;lt;CellStyle CssClass="columnTextDisabled"&amp;gt;
                                &amp;lt;/CellStyle&amp;gt;
                            &amp;lt;/ISWebGrid:WebGridColumn&amp;gt;                              
                            &amp;lt;ISWebGrid:WebGridColumn Caption="Numero punti" DataMember="NUM_PUNTI" Name="NUM_PUNTI" AllowMultiLine="true"
                                Width="1px" FilterEditType="TextBox" DataType="System.Integer" &amp;gt;
                                &amp;lt;CellStyle CssClass="columnDisabled"&amp;gt;
                                &amp;lt;/CellStyle&amp;gt;
                            &amp;lt;/ISWebGrid:WebGridColumn&amp;gt; 
                            &amp;lt;ISWebGrid:WebGridColumn Caption="Sconto a valore" DataMember="SCNT_VAL" Name="SCNT_VAL" AllowMultiLine="true"
                                Width="1px" FilterEditType="TextBox" DataType="System.Decimal"   &amp;gt;
                                &amp;lt;CellStyle CssClass="columnDisabled"&amp;gt;
                                &amp;lt;/CellStyle&amp;gt;
ONAFTEREXITEDITMODE:
function onAfterExitEditMode(controlId, tblName, editObject)
    {
        var WebGrid1 = ISGetObject(controlId);   
        var cell = wgGetCellByElement(editObject.cellElement);                   
        var selRow = cell.Row;
        //Giuseppe Caranfa 29/04/2011: acquisisco il contenuto della riga selezionata per ogni singola cella
        //                             In tutta la funzione cells.GetNamedItem è stato sostituito con selRow.GetCell
        //var cells = selRow.GetCells();
        var intPrenTotForn = selRow.GetCell("QT_PREN_TOTL").Value;                        
        if(editObject.ToCellObject().Name == "QT_PREN_TOTL")
        {
            //arrotondo al multiplo di uxi
            intPrenTotForn = editObject.element.value;  
            intPrenTotForn = Number(intPrenTotForn);                        
            //var uxi = selRow.GetCells().GetNamedItem("NU_PEZZ_COLL").Value;                
            var uxi = selRow.GetCell("NU_PEZZ_COLL").Value;                
            intPrenTotForn = ValidateQtPren(intPrenTotForn,uxi);            
            if(cell.Modified == true)
            {
                selRow.GetCell("QT_PREN_TOTL").SetText(intPrenTotForn.toString(),true, true);
                selRow.GetCell("QT_PREN_TOTL").SetValue(intPrenTotForn.toString(),true);                                                                     
            }
        } 
        
        //valido lo sconto promo
        if(editObject.ToCellObject().Name == "SCNT_PROMO" || editObject.ToCellObject().Name == "TP_SCNT_PROMO")
        {
            
            //var tp_sconto = selRow.GetCells().GetNamedItem("TP_SCNT_PROMO").Value;
            var tp_sconto = selRow.GetCell("TP_SCNT_PROMO").Value;
            if(editObject.ToCellObject().Name == "TP_SCNT_PROMO")
                tp_sconto_promo = editObject.element.value;
            //var sconto_promo = selRow.GetCells().GetNamedItem("SCNT_PROMO").Value;        
            var sconto_promo = selRow.GetCell("SCNT_PROMO").Value;        
            if(editObject.ToCellObject().Name == "SCNT_PROMO")
                sconto_promo = editObject.element.value;
            //var costo_netto = selRow.GetCells().GetNamedItem("COST_NETT_STD").Value;
            var costo_netto = selRow.GetCell("COST_NETT_STD").Value;
            costo_netto = Number(costo_netto.replace(",","."));
            if(tp_sconto == '€')
            {
                if(sconto_promo &amp;gt; costo_netto)
                {
                    sconto_promo = costo_netto;  
                    selRow.GetCell("SCNT_PROMO").SetText(sconto_promo.toString().replace(".",","),true, true);
                    selRow.GetCell("SCNT_PROMO").SetValue(sconto_promo.toString().replace(".",","),true);
                    //if(cell.Modified == true)
                    //    ErrorMessage("0","Attenzione: stai inserendo uno sconto promo maggiore del costo netto standard","");   
                }
                                                
            }
            if(tp_sconto == '%')
            {
                if(sconto_promo &amp;gt; 100) 
                {        
                    sconto_promo = 100;
                    selRow.GetCell("SCNT_PROMO").SetText(sconto_promo.toString().replace(".",","),true, true);
                    selRow.GetCell("SCNT_PROMO").SetValue(sconto_promo.toString().replace(".",","),true);
                    //if(cell.Modified == true)
                    //    ErrorMessage("0","Attenzione: stai inserendo uno sconto promo maggiore del costo netto standard","");
                }
            }
            /*if(sconto_promo != "")
            {
                cells.GetNamedItem("SCNT_PROMO").SetText(sconto_promo.toString().replace(".",","),true, true);
                cells.GetNamedItem("SCNT_PROMO").SetValue(sconto_promo.toString().replace(".",","),true);     
            }*/
        }
        //selRow.AddPendingChanges();
        //Paola Tripolisi 23/07/2013: gestione nuove dinamiche promo abilitazione per tipologia
        if (editObject.ToCellObject().Name == "TIPL_DE") 
        {   
            var tp_sconto = selRow.GetCell("TP_SCNT_PROMO").Value;
            if (editObject.ToCellObject().Name == "TP_SCNT_PROMO")
                tp_sconto_promo = editObject.element.value;
                            
            var tiplCd = selRow.GetCell("TIPL_DE").Value;
            switch (tiplCd) {
                case "4": case "6":case "7":  //MxN
                    selRow.GetCell("NUM_SCAGL").SetForceNoEdit(true);
                    selRow.GetCell("NUM_SCAGL").SetText("", true, true);
                    selRow.GetCell("NUM_SCAGL").SetValue("", true);
                    selRow.GetCell("NUM_SCAGL").CellElement.style.backgroundColor = "#EEECE1";
                    
                    selRow.GetCell("COD_UNIONE").SetForceNoEdit(false);
                    selRow.GetCell("COD_UNIONE").CellElement.style.backgroundColor = "#FFFFFF";
                    
                    selRow.GetCell("TP_CLIENTE").SetForceNoEdit(true);
                    selRow.GetCell("TP_CLIENTE").SetText("", true, true);
                    selRow.GetCell("TP_CLIENTE").SetValue("", true);
                    selRow.GetCell("TP_CLIENTE").CellElement.style.backgroundColor = "#EEECE1";
                    
                    selRow.GetCell("NUM_PUNTI").SetForceNoEdit(true);
                    selRow.GetCell("NUM_PUNTI").SetText("", true, true);
                    selRow.GetCell("NUM_PUNTI").SetValue("", true);
                    selRow.GetCell("NUM_PUNTI").CellElement.style.backgroundColor = "#EEECE1";
                    
                    selRow.GetCell("SCNT_VAL").SetForceNoEdit(true);
                    selRow.GetCell("SCNT_VAL").SetText("", true, true);
                    selRow.GetCell("SCNT_VAL").SetValue("", true);
                    selRow.GetCell("SCNT_VAL").CellElement.style.backgroundColor = "#EEECE1";
                    break;
                case "9": //SCONTAPUNTI
                    selRow.GetCell("NUM_SCAGL").SetForceNoEdit(true);
                    selRow.GetCell("NUM_SCAGL").SetText("", true, true);
                    selRow.GetCell("NUM_SCAGL").SetValue("", true);
                    selRow.GetCell("NUM_SCAGL").CellElement.style.backgroundColor = "#EEECE1";
                    selRow.GetCell("COD_UNIONE").SetForceNoEdit(true);
                    selRow.GetCell("COD_UNIONE").SetText("", true, true);
                    selRow.GetCell("COD_UNIONE").SetValue("", true);
                    selRow.GetCell("COD_UNIONE").CellElement.style.backgroundColor = "#EEECE1";
                    selRow.GetCell("TP_CLIENTE").SetForceNoEdit(false);
                    selRow.GetCell("TP_CLIENTE").SetText("", true, true);
                    selRow.GetCell("TP_CLIENTE").CellElement.style.backgroundColor = "#FFFFFF";
                    
                    selRow.GetCell("NUM_PUNTI").SetForceNoEdit(false);
                    selRow.GetCell("NUM_PUNTI").CellElement.style.backgroundColor = "#FFFFFF";
                    
                    selRow.GetCell("SCNT_VAL").SetForceNoEdit(false);
                    selRow.GetCell("SCNT_VAL").CellElement.style.backgroundColor = "#FFFFFF";
                    break;
                case "10": //PIUCOMPRIMENOSPENDI
                    selRow.GetCell("NUM_SCAGL").SetForceNoEdit(false);
                    selRow.GetCell("NUM_SCAGL").CellElement.style.backgroundColor = "#FFFFFF";
                    
                    selRow.GetCell("COD_UNIONE").SetForceNoEdit(false);
                    selRow.GetCell("COD_UNIONE").CellElement.style.backgroundColor = "#FFFFFF";
                    selRow.GetCell("TP_CLIENTE").SetForceNoEdit(false);
                    selRow.GetCell("TP_CLIENTE").SetText("", true, true);
                    selRow.GetCell("TP_CLIENTE").CellElement.style.backgroundColor = "#FFFFFF";
                    selRow.GetCell("NUM_PUNTI").SetForceNoEdit(true);
                    selRow.GetCell("NUM_PUNTI").SetText("", true, true);
                    selRow.GetCell("NUM_PUNTI").SetValue("", true);
                    selRow.GetCell("NUM_PUNTI").CellElement.style.backgroundColor = "#EEECE1";
                    selRow.GetCell("SCNT_VAL").SetForceNoEdit(true);
                    selRow.GetCell("SCNT_VAL").SetText("", true, true);
                    selRow.GetCell("SCNT_VAL").SetValue("", true);
                    selRow.GetCell("SCNT_VAL").CellElement.style.backgroundColor = "#EEECE1";
                    break;
                default:
                    selRow.GetCell("NUM_SCAGL").SetForceNoEdit(true);
                    selRow.GetCell("NUM_SCAGL").SetText("", true, true);
                    selRow.GetCell("NUM_SCAGL").SetValue("", true); 
                    selRow.GetCell("NUM_SCAGL").CellElement.style.backgroundColor = "#EEECE1";
                    
                    selRow.GetCell("COD_UNIONE").SetForceNoEdit(true);
                    selRow.GetCell("COD_UNIONE").SetText("", true, true);
                    selRow.GetCell("COD_UNIONE").SetValue("", true);
                    selRow.GetCell("COD_UNIONE").CellElement.style.backgroundColor = "#EEECE1";
                    
                    selRow.GetCell("TP_CLIENTE").SetForceNoEdit(true);
                    selRow.GetCell("TP_CLIENTE").SetText("", true, true);
                    selRow.GetCell("TP_CLIENTE").SetValue("", true);
                    selRow.GetCell("TP_CLIENTE").CellElement.style.backgroundColor = "#EEECE1";
                    
                    selRow.GetCell("NUM_PUNTI").SetForceNoEdit(true);
                    selRow.GetCell("NUM_PUNTI").SetText("", true, true);
                    selRow.GetCell("NUM_PUNTI").SetValue("", true);
                    selRow.GetCell("NUM_PUNTI").CellElement.style.backgroundColor = "#EEECE1";
                    
                    selRow.GetCell("SCNT_VAL").SetForceNoEdit(true);
                    selRow.GetCell("SCNT_VAL").SetText("", true, true);
                    selRow.GetCell("SCNT_VAL").SetValue("", true);
                    selRow.GetCell("SCNT_VAL").CellElement.style.backgroundColor = "#EEECE1";
                    break;
            } //chiusura switch
        }
    
        if (editObject.ToCellObject().Name == "NUM_SCAGL") 
        {
            var scagl = selRow.GetCells().GetNamedItem("NUM_SCAGL").Value;
            var lung = scagl.length;
            if (lung == 1) {
                if (scagl &amp;lt;= 0 || scagl &amp;gt; 5) {
                    selRow.GetCell("NUM_SCAGL").SetText("", true, true);
                    selRow.GetCell("NUM_SCAGL").SetValue("", true);
                }
                else selRow.GetCell("NUM_SCAGL").SetValue(Number(scagl), true);
            }
            else {
                selRow.GetCell("NUM_SCAGL").SetText("", true, true);
                selRow.GetCell("NUM_SCAGL").SetValue("", true);
            }
        }
        
        if (editObject.ToCellObject().Name == "COD_UNIONE") 
        {
            var unione = selRow.GetCells().GetNamedItem("COD_UNIONE").Value;
            var lung_un = unione.length;
            if (lung_un &amp;gt;= 1 &amp;amp;&amp;amp; lung_un &amp;lt;= 3) {
                unione = str_pad_left(unione, "0", 3);
                selRow.GetCell("COD_UNIONE").SetText(unione, true, true);
            }
            else {
                selRow.GetCell("COD_UNIONE").SetText("", true, true);
                selRow.GetCell("COD_UNIONE").SetValue("", true);
            }
        }
    }&lt;/pre&gt;
&lt;p&gt; &lt;/p&gt;
&lt;p&gt;&lt;br /&gt;&lt;/p&gt;</description></item></channel></rss>