User Profile & Activity

Udayan Pratap Member
Page
of 2

Thanks Hans! I was able to solve the issue. I have used your code and made PromptUnsavedChanges="false" to make it work. 


Is there a way to change the Batch Update settings property at run time in javascript? Please let me know.


btw, I am marking your solution as the correct approach. It works absolutely grt! :) Thanks for the solution.


-Udayan

Hans,

Thanks for the code. I have made some changes to the code and it works fine (except for one small issue that I am facing).

function saveDecision() {
        var grid = ISGetObject("WebGrid1");
        var ddl = document.getElementById("<%= ddlDecision.ClientID %>");
        var checkedRows = grid.RootTable.GetCheckedRows();
        var ddlValue = ddl.options[ddl.selectedIndex].value;
        if (checkedRows.length > 0) {
            if (!grid.IsInProgress) {
                for (i = 0; i < checkedRows.length; i++) {
                    var checkedRow = grid.RootTable.GetCheckedRows()[i];
                    var selectedRow = grid.RootTable.ToRowObject(checkedRow);
                    var cells = selectedRow.GetCells();
                    if (selectedRow.KeyValue != '') {
                        // update the selected row's cells value
                        cells.GetNamedItem("Decision").SetText(ddlValue, true);
                        // update the selected row object
                        selectedRow.Update();
                    }
                }
                if (i >= checkedRows.length) {
                    i = 0;
                }
            }
        }
        return true;
    }

 I have removed the setInterval function from the code. I am not sure why do we need it. Please let me know what is the purpose of this function.

Also, though it is working fine, I am finding that a pop-up window opens in the grid that states "Are you sure you want to navigate away from the page?....." <attachment - error.jpg>


Please let me know how to take this out?

Hello Bernard,

 

One of the major requirement in my project is to select multiple cells from one of the columns and paste it in excel. Currently, the users are filtering the columns first, then hiding all the other columns and then they are doing a Row Selection of all the filtered values from that columns. Its a 3 step process for them and its time consuming considering they access 100s of columns at one time.

Please propose any better way of achieving the same result.

 

Looking forward to hearing back from you.

 

(On a relatively different topic, I have restaged my laptop recently and now am not able to add the License back to the License Manager. I am getting the error - The activation count has exceeded the maximum allowed usage of this license. I have mailed about this concern to the accounts department but havent heard back from them. Can you please suggest what to do?)

 

Thanks

Udayan 

Posted: August 16, 2011 1:40 AM

Hi Yudi,

Thanks for the mail and the response. Your response was useful. But I am trying to do the same thing in my project (file attached) to get the webgrid working using Update Panel. But my efforts are useless. I am not able to load the data into the webgrid. And neither I am able to save the webgrid schema to the xml.

Please advice. 

-Udayan

Thanks for the reply Riendy. 

After I change the position of the columns inside the webgrid from the UI and then call Button1_Click event, I am not able to save the new structure. It is taking the original structure. 

For example - say my grid is bound to a datatable with two columns A and B, with A at position 0 and B at position 1. when I swap the column-positions on the UI and then call the Button1_click event, the xml/isl file still shows the position of the column A as 0 and B as 1. It should show A as 1 and B as 0.

Please assist.

Riendy,

Thanks for the quick reply. But I am not able to save the correct table structure to the XML. It is saving the default structure that was bound to the grid initially. Following is the scenario-

a) I bind the dataset to the grid using OnInitialize and PrepareDatabinding events.

b) I change the column positions. (No flypostback happens)

c) I click the save button to save the new structure.

The saved xml doesnt contain the information about the change in the column positions, but instead saves the original structure. 

Please suggest how to save the new table structure with new column position information.

Thanks

Udy

All times are GMT -5. The time now is 9:43 AM.
Previous Next