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
264
Add Data from WebCombo to WebGrid...
posted

Don't know if this is the correct forum to ask this in.  It may be a webgrid question.

What I am trying to do is the following:

I currently have a grid that an admin uses for security to a web application.  Names and information is manually typed in.  Obviously there is a chance for error and someone not be able to access the application.

I have created a WebCombo that queries our HR table to bring back data for a user name that is typed in.

What I would like to do is add a button that adds a new row to my grid with the data from the combo box.  I don't want to add the data to the database yet, because one the row is added, there are some other options that the admin can choose via checkboxes.

I have the grid in a WARP panel and I can add a blank row using Me.gridname.Rows.Add() when I click the WebImageButton.

Any ideas or direction would be greatly appreciated.

I have attached an image so that you can see what I want to do.

 

Thanks.

Doyen Blair

 

 

 

  • 29417
    Offline posted

    Hello Doyen,

     

    I know it’s been a while since you posted your question but if you still need help with this I’d be glad to offer some assistance. I believe this discussion will benefit other community members as well.

     

    I’ve prepared a sample that I think reflects you scenario. I’m using the following code for the adding of the rows (for the OnClientClick of the button):

       function add() {

                  var grid = igtbl_getGridById("grid");

     

                  var combo = igcmbo_getComboById("WebCombo1");

                  //definethe strings you'll add to the grid

                  var text1 = combo.getDataValue();

                  var text2 = combo.getDisplayValue();

                    var newRow = igtbl_addNew(grid.Id, 0);

                    var id = newRow.Id;

                    newRow.cells[0].setValue(text1);

                    newRow.cells[1].setValue(text2);           

                

               

              }   

     

    Please refer to the attached sample as well. If you have any questions don't hesitate to ask.

     

    Best Regards,

    Maya Kirova

    Developer Support Engineer

    Infragistics, Inc.

    http://es.infragistics.com/support

     

     

    AddDataWebComboToWG.zip