Hi all,
What is the best method to updating the stylesheet for a specific row that has been edited? I have code that updates the editing core for a given web data grid. It adds a drop-down selector for one column, check box for another and a text box for the final column. When I modify any entry in a row, I wanted it to highlight the row in some way? As Auto-CRUD is off, I tried to add the RowUpdating event to the editing core, but I get a NullReferenceException on that line of code. I thought I could use that event to alter the CSS style for the ROW through code-behind, but that is not working?
Any help? I tried to use a RowEditTemplate, but that is not working for me either. I have to define the web data grid editing functions in code behind because the grid is multi-purpose and loads the data dynamically through code-behind, but in one case, the grid ends up being editable.
Help is appreciated.
Paul
Setting the primary key in the data table got things working.
I don't get the error when I click on the "save changes' button without making any grid changes. Right now, the only code I do in the handler is initialize a string and the
only purpose is to set a break-point in the handler method, so I know the method was reachable.
The full error seems to the following from the Chrome logs:
Uncaught Sys.WebForms.PageRequestManagerServerErrorException: Sys.WebForms.PageRequestManagerServerErrorException: Table doesn't have a primary key.
Error.create @ MicrosoftAjax.js:6Sys.WebForms.PageRequestManager._createPageRequestManagerServerError @ MicrosoftAjaxWebForms.js:6Sys.WebForms.PageRequestManager._parseDelta @ MicrosoftAjaxWebForms.js:6Sys.WebForms.PageRequestManager._onFormSubmitCompleted @ MicrosoftAjaxWebForms.js:6(anonymous function) @ MicrosoftAjax.js:6(anonymous function) @ MicrosoftAjax.js:6Sys.Net.WebRequest.completed @ MicrosoftAjax.js:6_onReadyStateChange @ MicrosoftAjax.js:6
Hello Paul,
Thank you for the update. I am some follow up questions?
What is the full error message you get when clicking the WebImageButton? Do you still get the error if you click the button without making any changes to the grid? Do you perform any code on click on the button?
Almost there.....I was able to enable batch editing and get my desired CSS stylesheet when the road is updated. However, when I hit my WebImageButton to "Save Changes", I get a HttpUnhandledException error. It doesn't even reach my server handler for the web image button.
Batch Updating is not enabled, I think. will double-check. The style/class name I would like to apply was a custom-add which has a background-color to a TR tag. in ig_grid.css
What does batch updating do? I would like users to be able to update the data in the grid and then hit a "save changes" button which would then cycle through all the updates and update them in the DB.