iSeller Commerce
iSeller POS Retail
iSeller POS F&B
iSeller POS Express
Crosslight
WebUI
ClientUI
What's New
Download Trial
Web Solution
Mobile Solution
Enterprise Solution
Custom Development
Blog
Community
Latest Development Blogs
ForumPostTopic
Browse By Tag
Hello,
we are using WebGrid 7 and having a strange problem.
<ISWebGrid:WebGrid ID="GridHandle" runat="server" Width="99%" OnInitializeRow="WebGrid1_InitializeRow" UseDefaultStyle="True" DataSourceID="ISDataSource1" DataMember="Messages_Center"> <LayoutSettings AllowSorting="No" AutoFitColumns="true" PagingLoadMode="Custom" AllowGrouping="No" PagingMode="ClassicPaging" PagingSize="20"> <TextSettings Language="UseCustom" UseLanguage="zh-CN"> </TextSettings> </LayoutSettings> <RootTable DataKeyField="Row_ID"> <Columns> <ISWebGrid:WebGridColumn Name="RowNumber" Caption="RowNumber" Width="40px"> </ISWebGrid:WebGridColumn> <ISWebGrid:WebGridColumn AllowGrouping="No" AllowSizing="No" AllowSorting="No" Bound="False" ColumnType="CheckBox" EditType="NoEdit" IsRowChecker="True" Name="colChk" ShowInSelectColumns="No" Width="25px"> </ISWebGrid:WebGridColumn> <ISWebGrid:WebGridColumn Name="BeiZhu" Caption="BeiZhu" DataMember="BeiZhu" Width="150px"> </ISWebGrid:WebGridColumn> <ISWebGrid:WebGridColumn Name="TargetDispName" Caption="TargetDispName" DataMember="TargetDispName" Width="150px"> </ISWebGrid:WebGridColumn> <ISWebGrid:WebGridColumn Name="FromDispName" Caption="FromDispName" DataMember="FromDispName" Width="150px"> </ISWebGrid:WebGridColumn> <ISWebGrid:WebGridColumn Name="GenerateDate" Caption="GenerateDate" DataMember="GenerateDate" Width="150px"> </ISWebGrid:WebGridColumn> <ISWebGrid:WebGridColumn Name="Edit" Caption="View" ColumnType="Template" Width="35px" IsAutoWidth="false"> <CellStyle HorizontalAlign="Center"> </CellStyle> <CellTemplate> <a href='javascript:window.showModalDialog("Detail.aspx?Row_ID=<%#DataBinder.Eval(Container.DataItem,"Row_ID")%>")'> <img src='bigview.gif' border='0'></a> </CellTemplate> </ISWebGrid:WebGridColumn> <ISWebGrid:WebGridColumn Name="Enter" Caption="Delete" ColumnType="Template" Width="40px"> <FooterStyle HorizontalAlign="Center" /> <CellStyle HorizontalAlign="Center" Width="40px"> </CellStyle> <CellTemplate> <img src='Delete.gif' style="cursor: hand;" onclick="deleteOnePW('<%#DataBinder.Eval(Container.DataItem,"Row_ID")%>','<%#DataBinder.Eval(Container.DataItem,"BeiZhu")%>');" /> </CellTemplate> </ISWebGrid:WebGridColumn> </Columns> </RootTable> </ISWebGrid:WebGrid>
<script> function deleteOnePW(rowGuid, BeiZhu) { document.getElementById("<%= TxtPingWei.ClientID %>").value = rowGuid; document.getElementById("<%= TxtBeiZhu.ClientID %>").value = BeiZhu; document.getElementById("<%= DelDangQian.ClientID %>").click(); } </script>
the details of the problem are as follows,when I click Delete Image and it will show "Index was outside the bounds of the array" error.
However, we change the 'Delete' image's template to
<img src='Delete.gif' style="cursor: hand;" onclick="deleteOnePW('<%#DataBinder.Eval(Container.DataItem,"Row_ID")%>');" />
it will be all right.Should the "deleteOnePW" function only have one parameter?However, when I delete the "View" Column , it will be all right.(this issue does not occur)
<ISWebGrid:WebGrid ID="GridHandle" runat="server" Width="99%" OnInitializeRow="WebGrid1_InitializeRow" UseDefaultStyle="True" DataSourceID="ISDataSource1" DataMember="Messages_Center"> <LayoutSettings AllowSorting="No" AutoFitColumns="true" PagingLoadMode="Custom" AllowGrouping="No" PagingMode="ClassicPaging" PagingSize="20"> <TextSettings Language="UseCustom" UseLanguage="zh-CN"> </TextSettings> </LayoutSettings> <RootTable DataKeyField="Row_ID"> <Columns> <ISWebGrid:WebGridColumn Name="RowNumber" Caption="RowNumber" Width="40px"> </ISWebGrid:WebGridColumn> <ISWebGrid:WebGridColumn AllowGrouping="No" AllowSizing="No" AllowSorting="No" Bound="False" ColumnType="CheckBox" EditType="NoEdit" IsRowChecker="True" Name="colChk" ShowInSelectColumns="No" Width="25px"> </ISWebGrid:WebGridColumn> <ISWebGrid:WebGridColumn Name="BeiZhu" Caption="BeiZhu" DataMember="BeiZhu" Width="150px"> </ISWebGrid:WebGridColumn> <ISWebGrid:WebGridColumn Name="TargetDispName" Caption="TargetDispName" DataMember="TargetDispName" Width="150px"> </ISWebGrid:WebGridColumn> <ISWebGrid:WebGridColumn Name="FromDispName" Caption="FromDispName" DataMember="FromDispName" Width="150px"> </ISWebGrid:WebGridColumn> <ISWebGrid:WebGridColumn Name="GenerateDate" Caption="GenerateDate" DataMember="GenerateDate" Width="150px"> </ISWebGrid:WebGridColumn> <ISWebGrid:WebGridColumn Name="Enter" Caption="Delete" ColumnType="Template" Width="40px"> <FooterStyle HorizontalAlign="Center" /> <CellStyle HorizontalAlign="Center" Width="40px"> </CellStyle> <CellTemplate> <img src='Delete.gif' style="cursor: hand;" onclick="deleteOnePW('<%#DataBinder.Eval(Container.DataItem,"Row_ID")%>','<%#DataBinder.Eval(Container.DataItem,"BeiZhu")%>');" /> </CellTemplate> </ISWebGrid:WebGridColumn> </Columns> </RootTable> </ISWebGrid:WebGrid>
Do you have any idea on what is causing this behaviour ?We need to fix this soon, kindly help
Thanks
You can get the row values in the javascript function without passing as arguments. Here is an example that uses only one bound value, and looks up teh row key value. You could also retreive the BeiZhu value from selObj.GetRowObject() object in javascript too, inspect the object at runtime to see how.
function deleteOnePW(BeiZhu){
var grid = ISGetObject("GridHandle");
var selObj = grid.GetSelectedObject();
if (selObj != null) {
document.getElementById("<%= TxtPingWei.ClientID %>").value = selObj.GetRowObject().KeyValue;
document.getElementById("<%= TxtBeiZhu.ClientID %>").value = BeiZhu;
document.getElementById("<%= DelDangQian.ClientID %>").click();
}
Xu, Unfortunately I could not replicate your issue on my end. Would you please help me to attach a simple runable sample to me? It's really help me to solve your issue faster.
Regards.Riendy
Hi Riendy,
the attachment files are the code and the sql server 2005 database.Thanks for your help!
Regards,
gavin
Hi Gavin,This issue will appear when use more than 1 parameter. I already forwarded this issue to our development team for further information. I will surely keep follow up our developers to solve this issue and let you know the updates as soon as possible.
or
Choose this if you're already a member of Intersoft Community Forum. You can link your OpenID account to your existing Intersoft Social ID.
Choose this if you don't have an Intersoft account yet. Your authenticated OpenID will be automatically linked to your new Intersoft account.
Enter your Wordpress Blogname