“Imagination is more important than knowledge. For while knowledge defines all we currently know and understand, imagination points to all we might yet discover and create.” - Albert Einstein


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.

  1. CoolCore.js and CoolCore.cs were added to IdeaSparx.CoolControls.Web project.
  2. 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) { }
    
  3. User can resize column headers' width.
  4. Column header and scroll position are preserved after a postback or callback.
What a great way to start the week!

Have a great Monday everyone.

Labels: , , , , , , , , , , , , ,

 Subscribe to feed

20 Responses to “CoolGridView New Release : Resizable Column Widths and Keeping Scroll Position”

  1. # Blogger ununiqueid

    Can CoolGridView create columns based on the dataset/table bound to it? Or do the columns have to be created in the markup?  

  2. # Blogger John Eric Sobrepena

    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.  

  3. # Anonymous Dario

    Good to see quick improvement  

  4. # Blogger John Eric Sobrepena

    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.  

  5. # Anonymous dario

    A very impressive feature: using cookies for preserving scroll position so user can log-off and log-in without losing his setting.  

  6. # Blogger John Eric Sobrepena

    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?  

  7. # Anonymous Dario

    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).  

  8. # Blogger jo

    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 ?  

  9. # Blogger John Eric Sobrepena

    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.  

  10. # Anonymous Anders

    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  

  11. # Anonymous Anonymous

    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  

  12. # Anonymous Anonymous

    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  

  13. # Anonymous Anonymous

    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?  

  14. # Blogger Sachin

    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  

  15. # Anonymous Michel

    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  

  16. # Blogger bsuresh

    i am adding one template field with one label control.
    but i cant find that control at runtime using findcontrol


    what should i do  

  17. # Blogger TonyS.

    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.  

  18. # Blogger Arian Cabrera

    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!!  

  19. # Anonymous Anonymous

    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 !  

  20. # Blogger Tavi Gomez

    Fixed header doesnt work in IE10 and my cells arent aligning with the header. Do you know a work around for this?  

Post a Comment



Links to this post

Create a Link

John Eric Sobrepena

John Eric Sobrepena
Hi, I am an I.T. professional who loves technology. I am right now into Android development. I am also a subject matter expert on C#, ASP.NET, WPF and Silverlight. Photography is one of my many hobbies.
Bookmark and Share

Type your Email

Follow me on Twitter.

Flickr Photostream



 Subscribe to feed


Powered by Blogger



© 2006 IdeaSparx | Blogger Templates by GeckoandFly.
No part of the content or the blog may be reproduced without prior written permission.