User Profile & Activity

Udayan Pratap Member
Page
of 2
Posted: September 20, 2012 10:44 AM

Hi Bernard,

I was able to solve this problem with your help. I appreciate your inputs. The solution fails when the column starts with characters like '%' or '#' Since we are doing it on key-press event, when I hold shift key, this event gets fired.

 

Please let me know a work-around.

 

Thanks

Udayan

Posted: September 12, 2012 4:50 PM

I am still not able to solve the second part of the problem. Follow the following steps -

a) Databind to the Webgrid.

b) Change the position of the columns. (AllowColumnMove="Yes")

c) change the value of one of the cells of one of the columns.

d) Click Accept All Changes for Batch Update.

 

You ll see that the column headers remain as-is but the column values come in the wrong position, as if the data and the column Name are disassociated.

Please let me know how to solve it.

 

Thanks

Udayan

Posted: September 12, 2012 4:34 PM

Hi Bernard,

Great solution. I have done some changes to the client-side functions and they work absolutely fine. If you see the code, you ll find that I have done minor changes in the AfterResponseProcess. I found that actionName should be 'Refresh' and not 'BatchUpdate' because the function is fired twice once after the BatchUpdate and once when the grid retrieves the data during the refresh.

  var widthCol = new Array();function BatchUpdateSuccess(controlId, hasPartialErrors, partialErrorsXml) {var WebGrid1 = ISGetObject("WebGrid1");//get header width and push it into array var headerElement = WebGrid1.GetFrameElement().children[1].children[0].children[0].children[0];for (var i = 0; i < headerElement.children.length - 2; i++)

widthCol.push(headerElement.children[i].offsetWidth);

return true;

}

function AfterReponseProcess(controlId, actionName, lastRequestObject, xmlResponseObject) {var WebGrid1 = ISGetObject("WebGrid1");//after Refresh set all the colgroup with array if (actionName == "Refresh") {var colGroup = WebGrid1.GetFrameElement().children[2].children[0].children[0];if (widthCol != null && widthCol.length !=0) {for (var i = 0; i < colGroup.children.length - 2; i++)

colGroup.children[i].width = widthCol[i];

widthCol.length = 0;

}

}

return true;

}

This brings us to the question - what ll happen when the user clicks refresh. Hence, I have put a check for widthCol !=null and widthCol.lenght !=0.
Posted: September 11, 2012 11:39 PM

Hi Bernard,

I am using IE8 and am doing the following -

a) Databind to the Webgrid.

b) Increase the width of one of the columns by dragging the column.

c) changing the value of one of the cells of that column.

d) Clicking Accept All Changes for Batch Update.

 

Even if you change the position of the column (say from position 1 to 2) and do the changes in one of the cells, after batch update, the column doesnt show up under the column heading. i.e. The column list shows Column A in position 1 and Column B in position 2 but the data for column A shows below column B and so forth.

btw I am generating the view dynamically i.e. I dont have the columns listed in the design time. Also, please give me some code snippet of how to use OnBatchUpdateSuccess event.

 

Thanks

Udayan

Posted: September 11, 2012 1:58 AM

Thanks Bernard! Appreciate it!

Posted: September 10, 2012 10:52 AM

Hi Bernard,

There are two scenarios -

a) My user base is very excel-oriented. So, they dont want to export and print the data. They are very picky about directly printing the data from the grid. :(

b) I have some functionalities that creates labels in the grid with data and bar-code. If you export it as excel or PDF, the printer ll not read it properly because of the width and height issues. I can fix them in the grid and ask the users to print directly from the grid.

But I have some work-around as of now. Its a request to kindly consider implementing grid print functionality.

 

Thanks

Udayan

Posted: September 10, 2012 10:46 AM

Thanks Hans for the solution. I am not sure why this particular issue is coming in my application.

But I was able to fix it by changing some of the CSS properties -

.WG5CE-CCS

{

height: 100% !important; overflow: auto !important;

}

By default it was taking a default height of 400px and overflow none.

Thanks

Udayan

Posted: September 5, 2012 10:34 PM

Thanks! Is it possible to add it as an enhancement in the next release? I am sure a lot of users ll like this functionality.

-Udayan

Posted: September 4, 2012 4:52 PM

Thanks Bernard! This solution is great. I am marking it as the solution.

But I am struggling with a small issue here. When I am typing say 'a' twice, it checks the first row and then goes to the next row. I donot want to check the row unless I explicitly click and check the row. Is there a property that I need to set to make sure the rows are checked only when I click it?

 

Please let me know.

 

Thanks

Udayan 

Hi Yousif,


Is it possible for you to send the code to how you achieved saving and loading the webgrid structure? I have a similar requirement and what to get some help.


Thanks!

All times are GMT -5. The time now is 4:50 AM.
Previous Next