User Profile & Activity

Guillermo Montes Member
Page
of 3
Posted: August 6, 2010 10:41 AM

Thanks Niven, it works now.

Thanks Niven, this works perfectly.

Posted: May 27, 2010 1:35 PM

Hi Glenn,

Yeah, I tried that as well... while it's true that it prevents you from interacting with the grid while the hourglass is displayed it doesn't quite cover the solution for spamming edits, you can still make the grid crash.

Is there no way to disable the grid while refreshing?

Regards

For some reason setHeight onAfterInitialize and setHeight OnAfterResponseProcess behave differently (they don't resize the grid to the same height). My solution for this was way overkill but worked, used jQuery selectors to get the rowcount and the height of the elements inside the grid.



Hi Glenn,

This solution doesn't work for grids with paging, once I go to a different page the grid will resize (incorrectly) again and I'm sure that some operations requiring a flypostback (sorting, refreshing) will resize the grid as well.

Try adding to the grid:

<LayoutSettings PagingMode="ClassicPaging" PagingSize="10">
        <ClientSideEvents OnAfterInitialize="wgScroll_OnAfterInitialize" />
    </LayoutSettings>    

 And on the DS:

protected void InitScroll(object sender, ISNet.WebUI.WebGrid.DataSourceEventArgs e)
        {
            e.DataSource = new List<KeyValuePair<string, string>>()
            {
                new KeyValuePair<string, string>("Test", "Test"),
                new KeyValuePair<string, string>("Test", "Test"),
                new KeyValuePair<string, string>("Test", "Test"),
                new KeyValuePair<string, string>("Test", "Test"),
                new KeyValuePair<string, string>("Test", "Test"),
                new KeyValuePair<string, string>("Test", "Test"),
                new KeyValuePair<string, string>("Test", "Test"),
                new KeyValuePair<string, string>("Test", "Test"),
                new KeyValuePair<string, string>("Test", "Test"),
                new KeyValuePair<string, string>("Test", "Test"),
                new KeyValuePair<string, string>("Test", "Test"),
                new KeyValuePair<string, string>("Test", "Test"),
                new KeyValuePair<string, string>("Test", "Test"),
                new KeyValuePair<string, string>("Test", "Test"),
                new KeyValuePair<string, string>("Test", "Test")
            };
        }

 Take a look at the grid behaviour on initial load and after paging. Is the ONLY solution giving it a fixed height?

Thanks for the workaround, Handy.

Posted: April 21, 2010 4:55 PM

Hi Yudi,

Thanks for you reply, it's still not what I need (and I see autoheight still has issues with the XHTML Doctype so that's not an option). 

I'm adding entries to my DataSource and refreshing the grid via a javascript Refresh()... problem is, your approach resizes the container, it's not really refitting the content in the grid to ocupy the new given height. Please see the attachments to see whatI'm talking about.... in ResizeGrid2 you can see the grid grows past the original position of the status bar but it displays as an empty canvas.

I went with another solution, instead of having a javascript function do the refresh, have it fire a customrequest.... then catch that onInitializePostback and there resize-refresh (with this effectively using two FlyPostBacks to refresh), but the same thing happens:

        protected void ResizeAndRefresh(object sender, ISNet.WebUI.WebGrid.PostbackEventArgs e)
        {
            if (e.Action == ISNet.WebUI.WebGrid.PostBackAction.Custom)
            {
                webGrid.ClientAction.InvokeScript(
                    string.Format("Resize({0});", GetNewGridHeight())
                    );
                webGrid.ClientAction.Refresh();
            }
        }

 Is there any way to resize (and re-fit) the grid?

Edit: Ok, so much for the attach file... It's not working.



Posted: April 6, 2010 9:59 AM

Hi,

Do you have a sample on this? I actually tried GetCachedDataSource() before. Even when I modify my IntiializeDataSource event to this I doesn't work. 

 protected void Initas(object sender, DataSourceEventArgs e)

        {
            var cachedDS = WebGrid1.GetCachedDataSource();
            var cached = WebGrid1.IsDataCached();
            if (!cached)
                e.DataSource = CommonService.GetCountries();
            else
                e.DataSource = cachedDS;
        }

 

IsDataCached() keeps returning false. I have on my AllowAutoDataCaching="true" grid tag.

Thanks

Posted: February 2, 2010 6:08 PM

Hi, we have this same problem. Do you really have no estimate on how much time this fix will take?

Posted: January 29, 2010 10:27 AM

Hi Julia,

I'll look into the WebDialogBox option, but just for the record... do you fully support the XHTML doctype? Because i've had some issues with the grid sliding when a column resizes or the editors showing up slightly larger that the cell they're trying to modify.

See these threads:

thread

thread

PS: We're using WebGrid 7 (2009 R1)

All times are GMT -5. The time now is 7:40 PM.
Previous Next