Your Privacy Matters: We use our own and third-party cookies to improve your experience on our website. By continuing to use the website we understand that you accept their use. Cookie Policy
245
Setting value(or index) of dropdownlist to value of index 1 (not 0)
posted
I have a dropdownlist of lookup table items (Yes, No, Exempt) that is within an infragistics ultrawebgrid column. The ultrawebgrid was built via code-behind. There are no HTML or asp tags for the DDL.  I've added a blank row to the top of the DDL via code, so now it shows a blank, Yes, No, Exempt.  

How can I set the DDL value to the value of the "Yes" item when the user enters the DDL?  I tried using javascript is the .aspx that is called from the .ClientSideEvents AfterEnterEditModeHandler of the aspx.vb.  However, I am unable to locate the DDL.  I can tell that I get to the cell because I have an alert set, but I am having troubling extracting the value from the list.

 

function enterGridRow(gridName, cellId) {                        var oGrid = igtbl_getGridById(gridName);                     
var oCell = igtbl_getCellById(cellId);                                                   
        if (oGrid.ClientID == '<%= CheckListGrid.ClientID %>') {
                                       
              
if (oCell.Column.Index == 4) {
                                               
                window.alert('In IF 2');
                                                        
              
for (var i = 0; i < oGrid.options.length; i++) {
                       
                   if (oGrid.options[i].value == "Yes") {
                        
                      oGrid.options[i].selected = true;
                        
                     break;
                       
                  
}
                  
             
}
               
         }
                           
   }                 
                                                           

                }