Your Privacy Matters: We use our own and third-party cookies to improve your experience on our website. By continuing to use the website we understand that you accept their use. Cookie Policy
535
ultrawebgrid databind()
posted

Hi,

We are using ultrawebgrid with ASP.NET c#. We are setting columns at design time like this:

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

<igtbl:UltraWebGrid ID="igvAccounts" runat="server" Style="z-index: 101"
        OnInitializeRow="igvAccounts_InitializeRow" StyleSetPath="~/CSS/grid.css" Visible="False"
        OnDataBound="igvAccounts_DataBound" OnItemCommand="igvAccounts_ItemCommand" OnUnload="igvAccountTransactions_Unload">
        <Bands>
            <igtbl:UltraGridBand DataKeyField="ID">
                <Columns>
                    <igtbl:TemplatedColumn Key="DID" Width="7%" IsBound="true" BaseColumnName="DID">
                        <CellTemplate>
                            <asp:LinkButton ID="lnkBtnView" runat="server" Text='<%# DataBinder.Eval(Container.DataItem, "DID") %>' CommandName="View" />
                        </CellTemplate>
                        <CellStyle HorizontalAlign="left" />
                        <Header Caption="DID" Title="Common ID" />
                    </igtbl:TemplatedColumn>
                    <igtbl:UltraGridColumn Width="7%" Key="Status" IsBound="true" BaseColumnName="Status">
                        <Header Title="Status" Caption="Status" />
                    </igtbl:UltraGridColumn>
                    <igtbl:UltraGridColumn Width="9%" Key="SettleStatus" IsBound="true" BaseColumnName="SettleStatus">
                        <Header Caption="SL Status" Title="SL Status" />
                    </igtbl:UltraGridColumn>
                    <igtbl:UltraGridColumn Width="10%" Key="TradeDate" IsBound="true" BaseColumnName="TradeDate" Format="MM/dd/yyyy" DataType="DateTime">
                        <Header Caption="Trade Date" Title="Trade Date" />
                    </igtbl:UltraGridColumn>
                    <igtbl:UltraGridColumn Width="7%" Key="Type" IsBound="true" BaseColumnName="Type">
                        <Header Title="Type" Caption="Type" />
                    </igtbl:UltraGridColumn>
                    <igtbl:TemplatedColumn Width="8%" Key="Category" IsBound="true" BaseColumnName="Category">
                        <Header Title="Category" Caption="Category" />
                        <CellTemplate>
                            <asp:Label ID="lblCategory" runat="server" Text='<%# DataBinder.Eval(Container.DataItem, "Category") %>' />
                            <asp:LinkButton ID="aReport" runat="server" Text='<%# DataBinder.Eval(Container.DataItem, "Category") %>' CommandArgument='<%# DataBinder.Eval(Container.DataItem, "CommonID") %>' CommandName="ViewReport" Visible="false" />
                        </CellTemplate>
                    </igtbl:TemplatedColumn>
                    ....
                </Columns>
                <AddNewRow View="NotSet" Visible="NotSet">
                </AddNewRow>
            </igtbl:UltraGridBand>
        </Bands>
        <DisplayLayout ViewType="OutlookGroupBy" Version="4.00" AllowSortingDefault="Yes" AllowColSizingDefault="Free"
            StationaryMarginsOutlookGroupBy="True" HeaderClickActionDefault="SortSingle" Name="igvRequests"
            BorderCollapseDefault="Separate" RowSelectorsDefault="No" TableLayout="Fixed" RowHeightDefault="20px"
            SelectTypeRowDefault="Extended" Section508Compliant="True" CellClickActionDefault="NotSet"
            ColWidthDefault="" RowSizingDefault="NotSet" StationaryMargins="Header" AutoGenerateColumns="False">
            <GroupByBox Hidden="True">
            </GroupByBox>
            <ActivationObject BorderColor="" BorderWidth="">
            </ActivationObject>
            <HeaderStyleDefault Cursor="Default" CssClass="gridheader">
            </HeaderStyleDefault>
            <RowAlternateStyleDefault CssClass="altrow">
            </RowAlternateStyleDefault>
            <FrameStyle Width="99%" Height="165px" CssClass="gridframe">
            </FrameStyle>
            <Images>
                <SortAscendingImage Url="~/Image/ascending.gif" />
                <SortDescendingImage Url="~/Image/descending.gif" />
            </Images>
            <RowStyleDefault CssClass="gridrow">
            </RowStyleDefault>
            <FixedCellStyleDefault CssClass="gridfixedcell">
            </FixedCellStyleDefault>
            <FixedHeaderStyleDefault CssClass="gridfixedheader">
            </FixedHeaderStyleDefault>
            <FixedFooterStyleDefault CssClass="gridfixedheader">
            </FixedFooterStyleDefault>
        </DisplayLayout>
    </igtbl:UltraWebGrid>

In code behind, we created a private method where we bind the grid with business object:

 private void BindGrid()
        {
            try
            {
                igvAccountTransactions.DataSource = businessobject;
                igvAccountTransactions.DataBind();
                ucExportGrid.Visible = igvAccountTransactions.Rows.Count > 0;
            }
            catch (.....)
            {
                //exception handling;
               
            }            
        }

 We call this BindGrid from certain events like page load, dropdownlist selectedindexchanged, refresh button click event and where ever required.

On a page we have client, from and to dates to choose and then click on 'Refresh' button. This button refreshes the grid.

What is happening is: when user comes into this page  and selects cleint and date and clicks on 'Refresh' button for 1st time, comes back pretty quick with in 30 seconds. Don't change any selections on page and click again on 'Refresh' button, it is taking 3 minutes for it to come back. When I trouble shooted, data is coming back quickly from database on igvAccount.datarouce line. When I do step 11 (step into) igvAccounts.databind() line is taking 2 minutes and 30 seconds. Then initialize row event and databound event taking rest of the time.

I am not sure what is wrong with databind() and how to trouble shoot it.

Thanks

 

Parents Reply Children
No Data