CoolGridView New Release : Resizable Column Widths and Keeping Scroll Position
21 Comments Published by John Eric Sobrepena on Jan 25, 2010
I am pleased to announce that CoolGridView control for ASP.NET 2.0 now allows user-resizable columns and it remembers the current scroll position and column widths after a postback or callback.
You can download the latest release at Codeplex.com. Here are the following changes in this release (Build 20100124). Please take note that item #1 and #2 and breaking changes. If you are going to replace your CoolGridView from old releases with this new one, please modify your code according to the instructions provided.
Have a great Monday everyone.
You can download the latest release at Codeplex.com. Here are the following changes in this release (Build 20100124). Please take note that item #1 and #2 and breaking changes. If you are going to replace your CoolGridView from old releases with this new one, please modify your code according to the instructions provided.
- CoolCore.js and CoolCore.cs were added to IdeaSparx.CoolControls.Web project.
- If you are using CoolGridView inside an UpdatePanel, the add-on script is not needed anymore. You should remove the JavaScript code (as shown here) from your ASPX page. This functionality is now fully integrated in the CoolGridView control.
//Remove this JavaScript from your ASPX function AjaxEndRequestHandler(sender, args) { var p = sender._updatePanelClientIDs; if (p != null) for (var j = 0; j < p.length; j++) { var scripts = $get(p[j]).getElementsByTagName("script"); // .text is necessary for IE. for (var i = 0; i < scripts.length; i++) { try { eval(scripts[i].innerHTML || scripts[i].text); } catch (e2) { } } } } try {Sys.WebForms.PageRequestManager.getInstance() .add_endRequest(AjaxEndRequestHandler); }catch (e) { }
- User can resize column headers' width.
- Column header and scroll position are preserved after a postback or callback.
Have a great Monday everyone.
Labels: AJAX Control, AjaxControlToolkit, ASP.NET 2.0, CodePlex, CoolGridView, Fix Headers, Footer, GridView, IdeaSparks, Pager, Resizable columns, Resize column, Scroll Position, UpdatePanel
Can CoolGridView create columns based on the dataset/table bound to it? Or do the columns have to be created in the markup?
Hi ununiqueid, CoolGridView extends ASP.NET 2.0 GridView under the hood. So the answer to your question is "Yes" it can take the columns based on DataSet/DataTable.
Good to see quick improvement
With everyones help and your feedback, we should be able to slowly stabilize this control and promote it to "Beta" and then to a "Stable" release.
Hierarchical data presentation is now on the works :-) Stay tuned everyone.
A very impressive feature: using cookies for preserving scroll position so user can log-off and log-in without losing his setting.
That is a good suggestion Dario. I will keep a note of that in the future releases of CoolControls. How is the new CoolGridView control working for you so far?
I have some problems due to bad css. I'm busy tryng to fix. Different matter then the hidded column (you have a mail in this regard).
Hello mate!
Thanks a lot for ya control, after few arrangements works great on every browser appart safari where it's impossible to change size of the columns.
Do you have any suggestions ?
Hi Jo, I am glad to hear that the control worked for you. Regarding changing the size of the columns, could you elaborate on this more. Resizing the column width by a user was also tested to work in Safari 4.0.
Hi. I'm experimenting with this Cool GridView of yours. It appears to be very useful!
My data source is a dataTable with two label columns and a user-input-controlled number of value columns. Since the number of data columns is dynamic, I have to (?) use the setting AutoGenerateColumns="true" for the CoolGridview.
I have set a default Width that is appropriate for all value columns. However, for the two Label columns to the left in my coolgridview I want to specify a different width which is impossible(?) in the code-behind (C#), since the collection of columns does not have any members when I have not defined the columns explicitly.
Is there an easy way of setting width to specific columns under the above cicumstances?
I'm also interested in tips in how to freeze one or more columns from scrolling in the same way as the header row.
Best regards,
//Anders
Hi John,
We are using cool GridView in our project. It is very useful. We require pager to be modified and would want to provide dropdownlist box with number of records per page. Change the number of record per page on change event of dropdown and show selected 10 or 50 or 100 records etc.
Can you please help us to work on this.
Thanks,
Angna
hai john
I am Using this Control..its nice but it does not working with onrowediting event.
can we do edit, update,cancel,delete
i tryed for edit but the event _RowEditing is not working...
can you suggest me the solution for this problem...plz
Hi John, nice control and it's working great with no issues when replacing the original .net GridView. I'm using it in a time keeping app that's a replacement for Sage Timesheet. I have links in the header for days of the week and in the first column for employee name. My question is when a user clicks those links if there's a way to return the grid scroll position to where it was previously. Maybe an option for cookies/session variables that Dario suggests above?
Hi John,
We are using cool GridView in our project. It is very useful. It is working very nicely but I got one problem with grid header when user search for any header value then header moves for display the search but data values do not move.
Can you please help us to work on this?
Thanks,
Sachin
Hi John
I am happy with the control. There is one problem. My errorlog is filleing with file not found problems.
System.Web.HttpException: File does not exist.
at System.Web.StaticFileHandler.GetFileInfo(String virtualPathWithPathInfo, String physicalPath, HttpResponse response)
at System.Web.StaticFileHandler.ProcessRequestInternal(HttpContext context)
at System.Web.DefaultHttpHandler.BeginProcessRequest(HttpContext context, AsyncCallback callback, Object state)
at System.Web.HttpApplication.CallHandlerExecutionStep.System.Web.HttpApplication.IExecutionStep.Execute()
at System.Web.HttpApplication.ExecuteStep(IExecutionStep step, Boolean& completedSynchronously)
What am I missing?
regards
Michel J
i am adding one template field with one label control.
but i cant find that control at runtime using findcontrol
what should i do
Hi John, Thank you for your work. It is a major resource in my current project.
I have a unique scenario where I need the CoolGrid to NOT preserve the scroll position but to return to the top row instead. Is there a way to accomplish this?
Thank you again,
TonyS.
Please I need help,
I've used this great control y one website, and it works fine in IE, but when place the website in IIS, it looks like the theme is missing, cause the columns no longer show the "..." in case the content is bigger than the column width, same thing with the column header's gradient.
However if I run the website from chrome or firefox it shows correct.
Any help will be greatly appreciated!!
Hi. Your Control is Awesome.
But I have a Problem. It Can't resize the column automatically according to the panel width. i have to specify each column width seperately.
Please Help !
Fixed header doesnt work in IE10 and my cells arent aligning with the header. Do you know a work around for this?
Good appproach for freezing gridview headers in asp.net but some times this code is not working.