I am using the Ultrawebgrid and I have some template columns. I am binding the grid with "ObjectDatasource". while every template column click first it is calling the ObjectDatasource binding function and then it is calling page load. It is hitting database unnessarly. In sorting also it is calling first function and then page load. I tried lot to find the problem.
Please any one tell me what is going on.
Hello,
I believe the reason for that is that you have definied datasource twice - once in the ASPX using DataSourceID = " ... " and then once again, in the Page_Load event.
Declarative datasources are typically used only declaratively, in the ASPX. I believe in your case removing the databinding code in Page_Load will solve the double hitting database problem.
HTH,
hello any one help me to fix this problem.
Every row command event first it is hitting the data base and then it is calling the row command.
this is my template column.
<igtbl:TemplatedColumn AllowGroupBy="No" BaseColumnName="PKCustomerId" Key="Edit" IsBound="true" SortIndicator="Disabled" Width="2%"> <CellTemplate> <asp:ImageButton ID="ibtnView" runat="server" ToolTip="Edit" ImageUrl="../images/grid_edit.png" CommandName="view" /> </CellTemplate> </igtbl:TemplatedColumn>
Here my page
In aspx page: <igmisc:WebAsyncRefreshPanel ID="WebAsyncRefreshPanel1" runat="server" Width="100%" TriggerPostBackIDs="wgCustomer_ctl00_btnSearch"> <asp:Localize ID="lblNoRecords" runat="server"></asp:Localize> <igtbl:UltraWebGrid ID="wgCustomer" runat="server" Browser="xml" DisplayLayout-ScrollBar="Auto" Width="100%" DataSourceID="odsCustomer"> <DisplayLayout CompactRendering="False" AllowColSizingDefault="Free" AllowDeleteDefault="Yes" AllowSortingDefault="Yes" AllowUpdateDefault="Yes" BorderCollapseDefault="Separate" HeaderClickActionDefault="SortMulti" Name="wgCustomer" RowHeightDefault="20px" RowSelectorsDefault="No" SelectTypeRowDefault="Single" SelectTypeCellDefault="Extended" Version="4.00" ViewType="OutlookGroupBy" AllowColumnMovingDefault="OnClient" ScrollBarView="Horizontal" CellClickActionDefault="RowSelect" GridLinesDefault="None" HeaderTitleModeDefault="OnOverflow" TabDirection="BottomToTop" StationaryMargins="header"> <ActivationObject BorderWidth="" BorderColor=""> </ActivationObject> <RowExpAreaStyleDefault BackColor="White"> </RowExpAreaStyleDefault> <FooterStyleDefault BorderWidth="0px" BorderStyle="Solid" BackColor="LightGray"> <BorderDetails ColorLeft="White" WidthTop="0px" WidthLeft="0px" ColorTop="White"> </BorderDetails> </FooterStyleDefault> <RowStyleDefault BorderColor="Gray" Font-Size="8pt" Font-Names="Verdana" BorderWidth="1px" BorderStyle="Solid"> <Padding Right="4px" Left="4px"></Padding> <BorderDetails WidthTop="0px" WidthLeft="0px" ColorBottom="White" ColorRight="White"> </BorderDetails> </RowStyleDefault> <GroupByBox BoxStyle-BackColor="#FFFFC0" BoxStyle-HorizontalAlign="Center" BoxStyle-Height="10px"> </GroupByBox> <RowSelectorStyleDefault BackColor="Gainsboro"> </RowSelectorStyleDefault> <SelectedRowStyleDefault BackColor="LightGoldenrodYellow" ForeColor="Black" HorizontalAlign="Left" VerticalAlign="Middle"> </SelectedRowStyleDefault> <HeaderStyleDefault CssClass="darkcolor"> <BorderDetails ColorLeft="White" ColorRight="White" ColorTop="White"></BorderDetails> </HeaderStyleDefault> <EditCellStyleDefault BorderWidth="0px" BorderStyle="None"> </EditCellStyleDefault> <FrameStyle Font-Size="8pt" Font-Names="Verdana" Width="100%"> </FrameStyle> <Pager Alignment="Left" AllowPaging="True"> </Pager> <AddNewBox> <BoxStyle BorderWidth="1px" BorderStyle="Solid" BackColor="LightGray" /> </AddNewBox> </DisplayLayout> <Bands> <igtbl:UltraGridBand CellPadding="1" CellSpacing="1" Key="PKCustomerId" BaseTableName="Table" CellClickAction="RowSelect" Expandable="Yes" AllowUpdate="RowTemplateOnly" DataKeyField="PKCustomerId"> <AddNewRow View="NotSet" Visible="NotSet"> </AddNewRow> <Columns> /* here some of mycolums*/ </Columns> </igtbl:UltraGridBand> </Bands> </igtbl:UltraWebGrid> </igmisc:WebAsyncRefreshPanel> In vbpage:pageload event wgCustomer.DataSourceID = "odsCustomer" wgCustomer.DataBind() Please any one help me with this problem. I have tried lot but I could't found solutins.
I am binding the grid in pageload Not IsPostback only. But binding funtion is calling before the page load and then it is coming to page load event.
I am not able to find the solution. Is it problem with Ultrawebgrid or Objecdatasource. We have lots of grid, we are facing perfomance issues. Please help with this problem.