Rank: Member Groups: Member
Joined: 2/9/2010 Posts: 21
|
Hi, I have 2 grids on a page. I set Grid1 has ClientSideOnItemSelected event. Click any item on grid1 will trig OnItemSelected function.
OnItemSelected function will fill data to grid2. When more data fill into grid2, the vertical scrollbar will show on.
But user click the grid1 items at third time, then pull the grid2 vertical scrollbar will get an erorr. This is my sample code. (I don't write any vb code)
<%@ Page Language="VB" AutoEventWireup="false" CodeFile="EO_TEST.aspx.vb" Inherits="FORM_F1_EO_TEST" %> <%@ Register Assembly="EO.Web" Namespace="EO.Web" TagPrefix="eo" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"> <head runat="server"> <title>Untitled Page</title> <script type="text/javascript"> window.onload = function() { var grid1 = eo_GetObject("Grid1"), i, Item; for (i = 0; i < 5; i++) { Item = grid1.addItem(); Item.getCell(1).setValue(i); Item.getCell(2).setValue(i+1); } }
function OnItemSelected(grid) { var i, Item; var grid2 = eo_GetObject("Grid2"); var MasterValue = grid.getSelectedItem().getCell(1).getValue(); for (i = 0; i < grid2.getItemCount(); i++) grid2.deleteItem(i);
for (i = 0; i < 20; i++) { Item = grid2.addItem(); Item.getCell(1).setValue(i * MasterValue); Item.getCell(2).setValue(i * MasterValue + 1); } } </script> </head> <body> <form id="form1" runat="server"> <div> <eo:Grid ID="Grid1" runat="server" BorderColor="#7F9DB9" BorderWidth="1px" ColumnHeaderAscImage="00050104" ColumnHeaderDescImage="00050105" ColumnHeaderDividerImage="00050103" FixedColumnCount="1" Font-Bold="False" Font-Italic="False" Font-Names="Tahoma" Font-Overline="False" Font-Size="8.75pt" Font-Strikeout="False" Font-Underline="False" GoToBoxVisible="True" GridLineColor="220, 223, 228" GridLines="Both" Height="200px" Width="380px" ClientSideOnItemSelected="OnItemSelected"> <FooterStyle CssText="padding-bottom:4px;padding-left:4px;padding-right:4px;padding-top:4px;" /> <ItemStyles> <eo:GridItemStyleSet> <ItemStyle CssText="background-color: white" /> <ItemHoverStyle CssText="background-color: whitesmoke" /> <SelectedStyle CssText="background-color: #316ac5; color: white" /> <FixedColumnCellStyle CssText="border-right: #d6d2c2 1px solid; padding-right: 10px; border-top: #faf9f4 1px solid; border-left: #faf9f4 1px solid; border-bottom: #d6d2c2 1px solid; background-color: #ebeadb; text-align: right; color: black;" /> <CellStyle CssText="padding-left:8px;padding-top:2px;white-space:nowrap;" /> </eo:GridItemStyleSet> </ItemStyles> <ColumnTemplates> <eo:TextBoxColumn> <TextBoxStyle CssText="BORDER-RIGHT: #7f9db9 1px solid; PADDING-RIGHT: 2px; BORDER-TOP: #7f9db9 1px solid; PADDING-LEFT: 2px; FONT-SIZE: 8.75pt; PADDING-BOTTOM: 1px; MARGIN: 0px; BORDER-LEFT: #7f9db9 1px solid; PADDING-TOP: 2px; BORDER-BOTTOM: #7f9db9 1px solid; FONT-FAMILY: Tahoma" /> </eo:TextBoxColumn> </ColumnTemplates> <ContentPaneStyle CssText="border-bottom-color:#7f9db9;border-bottom-style:solid;border-bottom-width:1px;border-left-color:#7f9db9;border-left-style:solid;border-left-width:1px;border-right-color:#7f9db9;border-right-style:solid;border-right-width:1px;border-top-color:#7f9db9;border-top-style:solid;border-top-width:1px;" /> <GoToBoxStyle CssText="BORDER-RIGHT: #7f9db9 1px solid; BORDER-TOP: #7f9db9 1px solid; BORDER-LEFT: #7f9db9 1px solid; WIDTH: 40px; BORDER-BOTTOM: #7f9db9 1px solid" /> <Columns> <eo:RowNumberColumn> </eo:RowNumberColumn> <eo:StaticColumn HeaderText="Header1"> </eo:StaticColumn> <eo:StaticColumn HeaderText="Header2"> </eo:StaticColumn> </Columns> <ColumnHeaderStyle CssText="background-image:url('00050101');padding-left:8px;padding-top:3px;" /> </eo:Grid> <br /> <eo:Grid ID="Grid2" runat="server" BorderColor="#C7D1DF" BorderWidth="1px" ColumnHeaderAscImage="00050303" ColumnHeaderDescImage="00050304" ColumnHeaderDividerImage="00050302" FixedColumnCount="1" Font-Bold="False" Font-Italic="False" Font-Names="Verdana" Font-Overline="False" Font-Size="9pt" Font-Strikeout="False" Font-Underline="False" GridLineColor="199, 209, 223" GridLines="Both" Height="200px" ItemHeight="19" Width="380px"> <FooterStyle CssText="padding-bottom:4px;padding-left:4px;padding-right:4px;padding-top:4px;" /> <ItemStyles> <eo:GridItemStyleSet> <ItemStyle CssText="background-color: white" /> <ItemHoverStyle CssText="background-image: url(00050206); background-repeat: repeat-x" /> <SelectedStyle CssText="background-image: url(00050207); background-repeat: repeat-x" /> <CellStyle CssText="padding-left:8px;padding-top:2px; color:#336699;white-space:nowrap;" /> </eo:GridItemStyleSet> </ItemStyles> <ColumnTemplates> <eo:TextBoxColumn> <TextBoxStyle CssText="BORDER-RIGHT: #7f9db9 1px solid; PADDING-RIGHT: 2px; BORDER-TOP: #7f9db9 1px solid; PADDING-LEFT: 2px; FONT-SIZE: 8.75pt; PADDING-BOTTOM: 1px; MARGIN: 0px; BORDER-LEFT: #7f9db9 1px solid; PADDING-TOP: 2px; BORDER-BOTTOM: #7f9db9 1px solid; FONT-FAMILY: Tahoma" /> </eo:TextBoxColumn> </ColumnTemplates> <Columns> <eo:RowNumberColumn> </eo:RowNumberColumn> <eo:StaticColumn HeaderText="Header1"> </eo:StaticColumn> <eo:StaticColumn HeaderText="Header2"> </eo:StaticColumn> </Columns> <ColumnHeaderStyle CssText="background-image:url('00050301');padding-left:8px;padding-top:2px;font-weight: bold;color:white;" /> </eo:Grid> </div> </form> </body> </html>
|
Rank: Administration Groups: Administration
Joined: 5/27/2007 Posts: 24,194
|
Hi,
We have confirmed that to be a bug. We will try to fix it as soon as possible and provide you an update build.
In the mean time, you may want to put the second Grid inside a CallbackPanel and then update the second Grid through server side code. This actually works faster than updating the whole Grid on the client side because every time deleteItem and addItem is called, the Grid needs to recalculate its layout (scroll bar size, etc). This process repeats many times if you update the Grid on the client side. It only occurs once if you update the Grid on the server side.
If the total number of items in the Grid does not change, you can just call setValue to change cell value. That would update the cell but will not trigger calculation so it's the fastest way.
Thanks!
|
Rank: Administration Groups: Administration
Joined: 5/27/2007 Posts: 24,194
|
Hi,
We have posted a new build that should fix this issue. Please see your private message for download location.
Thanks!
|
Rank: Member Groups: Member
Joined: 2/9/2010 Posts: 21
|
Hi, Thanks!
|