User Profile & Activity

Conrad Hohenberger Member
Page
of 2

Andi,

Apparently this issue has been resolved in version 7.0.7200.305 with a LayoutSettings parameter PersistValueListOnCopy.  It works exactly the way I would expect.

I am disappointed that I received no notification from my feature request and stumbled on this accidentally.

 

Thanks

Conrad

Posted: February 15, 2010 8:39 AM

Here are my pages, hope they help!

Conrad

Posted: February 11, 2010 8:06 AM

Hi ca,

I added a custom button to the webgrid and called a separate page to do the upload.  The button doesn't show up until after the add.  I pass the key to the database to the new page, do the upload, update the row in the database and then return the the original page, which refreshes the grid and displays the filename.  I hope this helps.

 

Conrad

Posted: February 9, 2010 8:22 AM

Here is a screenshot and the code for the page in question.  I've included the calling page also.

 

Thanks,

Conrad

Posted: February 8, 2010 8:00 AM

Unfortunately it doesn't.  The checkbox can't be bound because the number of checkboxes in dynamic.  Is there another way to accomplish this?

 

Thanks,

Conrad

Posted: February 4, 2010 8:07 AM

Yudi,

I apologize for not providing the full scenario.

I have a WebGrid that I bind to a datasource on the server side.  The user defines how many "loads" they want their order delivered in and I dynamically add that many columns to the grid in the Page_Load server side event.  The user then splits their order by checking the appropriate boxes and I save that data via a server side UpdateRow and a stored procedure because that data is stored in a table that is different from the original datasource.  If the user returns to this page, I need to display what they previously selected, so I select the data from the database in the InitializeRow server side event and set the checkboxes.  The page is displayed correctly with the boxes checked, however, if they check a new box and save that data, the original checked boxes return nothing instead of true.  I hope this helps.

Thanks,

Conrad 

Posted: February 2, 2010 10:55 AM

Andi,

 

After spending time looking at the documentation for WebGrid on http://support.intersoftpt.com/, I discovered some code to  'Reconfigure the "Enter" key functions on EditMode'.  I was able to add the following section and make it work for Adding also.  I've attached the code for reference.

Thanks for your help!

Conrad

function WebGrid1_OnEditKeyDown(controlId) {if (event.keyCode == 13) {//cancel the event as it'll be handled manually event.returnValue = false;var grid = ISGetObject("WebGrid1");//get currently active edit cell var ac = grid.GetActiveEditCell();if (ac.rowElement.type == "Record") {//get the table object var tbl = grid.Tables[ac.tblName];grid.ExitEdit(1, 0, 0) // exit and update the row if dirty //find out if the table of current row is parent var isParent = (tbl.GetChildTables().length > 0) ? true : false;window.setTimeout(function() { SelectNext(ac, isParent); }, 500);//you can try to remove this line if you receive a javascript error return false;

}

if (ac.rowElement.type == "NewRow") {//get the table object var tbl = grid.Tables[ac.tblName];grid.ExitEdit(1, 0, 0) // exit and update the row if dirty //find out if the table of current row is parent var isParent = (tbl.GetChildTables().length > 0) ? true : false;window.setTimeout(function() { SelectNext(ac, isParent); }, 500);//you can try to remove this line if you receive a javascript error return false;

}

}

return true;

}

function SelectNext(ac, isParent) {var curRow = ac.rowElement;var tblElm = wgGetTable(curRow);var curRowIndex = curRow.rowIndex;//if a table is a parent, the index numbering increases by 2 var i = (isParent) ? 2 : 1;//check if current row is the last row of the table if (curRowIndex < tblElm.rows.length - i) {//get destination now var destRow = wgGetRowByPosition(tblElm, curRowIndex + i);//highlight the destination row //wgHighlightROw(destRow); //get the column name var cellName = wgGetColNameByCell(ac.element);//get the destination cell var destCell = wgGetCellByName(destRow, cellName);//select nextRow and highlight the destination cell window.setTimeout(function() { MoveRow(destRow, destCell); }, 500);

}

}

function MoveRow(destRow, destCell) {

wgGetRowByElement(destRow).Select();

wgHighlightEditCell(destCell);

}

Posted: February 2, 2010 8:18 AM

Andi,

 

Your example works as expected.  I've stumbled upon some new information.  When I get the null object error message with my code, it references the previous page, not the page containing the control.  Does this offer any clues to my problem?

Thanks,

Conrad

Posted: February 1, 2010 8:08 AM

Andi,

The first 3 columns seem to work and then I get this message on the 4th column.  As I stated earlier, the KeyDown event works if I hit the Enter key twice.  Does that offer any clues?

Thanks,

Conrad

Posted: January 29, 2010 8:29 AM

Andi,

Using the code above, I receive the error message attached.

Thanks,

Conrad

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