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
360
Need Help in Row Editting
posted

Hi All

i want to some thing similar to that which i have attached with this post. but i am facing following exeption and dont know what to do.

Server Error in '/TempTest' Application.

Databinding methods such as Eval(), XPath(), and Bind() can only be used in the context of a databound control.

Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.

Exception Details: System.InvalidOperationException: Databinding methods such as Eval(), XPath(), and Bind() can only be used in the context of a databound control.

Source Error:

Line 332:                                                <td style="font-size: 8pt; font-family: Verdana" align="left">
Line 333:                                                    Code:<br>
Line 334:                                                    <asp:TextBox ID="TextBox1" runat="server" Font-Size="8pt" Width="190px" columnKey="Code"
Line 335:                                                        Font-Name="Verdana" Font-Names="Verdana" Text='<%# Eval("Code") %>'></asp:TextBox></td>
Line 336:                                            </tr>

Source File: d:\ideaGate\Projects\AL-Sarraf\Prototype\Main\Bizlogix\Lookups\CurrencyManagement.aspx    Line: 334

Stack Trace:

[InvalidOperationException: Databinding methods such as Eval(), XPath(), and Bind() can only be used in the context of a databound control.]
   System.Web.UI.Page.GetDataItem() +2647882
   System.Web.UI.TemplateControl.Eval(String expression) +31
   ASP.lookups_currencymanagement_aspx.__DataBinding__control42(Object sender, EventArgs e) in d:\ideaGate\Projects\AL-Sarraf\Prototype\Main\Bizlogix\Lookups\CurrencyManagement.aspx:334
   System.Web.UI.Control.OnDataBinding(EventArgs e) +99
   System.Web.UI.Control.DataBind(Boolean raiseOnDataBinding) +92
   System.Web.UI.Control.DataBind() +15
   System.Web.UI.Control.DataBindChildren() +211
   System.Web.UI.Control.DataBind(Boolean raiseOnDataBinding) +102
   System.Web.UI.Control.DataBind() +15
   Infragistics.WebUI.UltraWebGrid.DBBinding.BindList(IEnumerable datasource) +760
   Infragistics.WebUI.UltraWebGrid.DBBinding.DataBind(Object dataSource, String dataMember) +950
   Infragistics.WebUI.UltraWebGrid.UltraWebGrid.DataBind() +405
   Lookups_CurrencyManagement.BindGridData() in d:\ideaGate\Projects\AL-Sarraf\Prototype\Main\Bizlogix\Lookups\CurrencyManagement.aspx.cs:99
   Lookups_CurrencyManagement.Page_Load(Object sender, EventArgs e) in d:\ideaGate\Projects\AL-Sarraf\Prototype\Main\Bizlogix\Lookups\CurrencyManagement.aspx.cs:22
   System.Web.Util.CalliHelper.EventArgFunctionCaller(IntPtr fp, Object o, Object t, EventArgs e) +14
   System.Web.Util.CalliEventHandlerDelegateProxy.Callback(Object sender, EventArgs e) +35
   System.Web.UI.Control.OnLoad(EventArgs e) +99
   System.Web.UI.Control.LoadRecursive() +50
   System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +627


Version Information: Microsoft .NET Framework Version:2.0.50727.3053; ASP.NET Version:2.0.50727.3053

 Here is Code Behind:

using System;

using System.Collections;

using System.Configuration;

using System.Data;

using System.Linq;

using System.Web;

using System.Web.Security;

using System.Web.UI;

using System.Web.UI.HtmlControls;

using System.Web.UI.WebControls;

using System.Web.UI.WebControls.WebParts;

using System.Xml.Linq;

using Infragistics.WebUI.UltraWebGrid;

public partial class Lookups_CurrencyManagement : System.Web.UI.Page

{

DataTable tblCurrencies = new DataTable();
protected void Page_Load(object sender, EventArgs e)

{

if (!Page.IsPostBack)

{

this.BindGridData();

}

}

 

 

protected void chkSelect_CheckedChanged(object sender, EventArgs e)

{

int count = 0;

 

Control cnt=null;

TemplatedColumn tc = null;

CheckBox radio = null;

tc = (TemplatedColumn) grdEnglishCurrencies.Columns[0];

for (int i = 0; i < grdEnglishCurrencies.Rows.Count; i++)

{

cnt = (
Control) tc.CellItems[i];

radio = (CheckBox) cnt.FindControl("chkSelect");

if (radio.Checked)

{

count++;

}

}

 

if (count > 0)

{

this.btnDeleteAbove.Enabled = true;this.btnDeleteBelow .Enabled = true;

}

else

{

this.btnDeleteAbove.Enabled = false;this.btnDeleteBelow .Enabled = false;

}

}

 

private void BindGridData()

{

 

 

//DataTable tblCurrencies = new DataTable();

tblCurrencies.Columns.Add(new DataColumn("ID"));

tblCurrencies.Columns.Add(new DataColumn("Code"));

tblCurrencies.Columns.Add(new DataColumn("Title"));

tblCurrencies.Columns.Add(new DataColumn("Description"));

tblCurrencies.Columns.Add("Sign");

tblCurrencies.Columns.Add("Coin");

tblCurrencies.Columns.Add("LeastDecValue");

tblCurrencies.Columns.Add("CalBasisDays");

tblCurrencies.Columns.Add("ExchRate");

tblCurrencies.Columns.Add("DefCurrency");

DataRow row = tblCurrencies.NewRow();

row["ID"] = 1;

row["Code"] = "code";

row["Title"] = "Title";

row["Description"] = "This is Some Description. I dont know any thisn ";

row["Sign"] = "$";

row["Coin"] = "Cell";

row["LeastDecValue"] = "2";

row["CalBasisDays"] = "4";

row["ExchRate"] = "34";

row["DefCurrency"] = "1";

tblCurrencies.Rows.Add(row);

this.grdEnglishCurrencies.DataSource = tblCurrencies;this.grdEnglishCurrencies.DataBind();

}

}

 

Here is Aspx Page:

<%@ Page Language="C#" MasterPageFile="~/MainMaster.master" AutoEventWireup="true" CodeFile="CurrencyManagement.aspx.cs" Inherits="Lookups_CurrencyManagement" Title="Untitled Page" %>

<%@ Register assembly="Infragistics2.WebUI.UltraWebGrid.v8.2, Version=8.2.20082.1000, Culture=neutral, PublicKeyToken=7dd5c3163f2cd0cb" namespace="Infragistics.WebUI.UltraWebGrid" tagprefix="igtbl" %>

<%@ Register assembly="Infragistics2.WebUI.UltraWebTab.v8.2, Version=8.2.20082.1000, Culture=neutral, PublicKeyToken=7dd5c3163f2cd0cb" namespace="Infragistics.WebUI.UltraWebTab" tagprefix="igtab" %> <%@ Register assembly="Infragistics2.WebUI.UltraWebNavigator.v8.2, Version=8.2.20082.1000, Culture=neutral, PublicKeyToken=7dd5c3163f2cd0cb" namespace="Infragistics.WebUI.UltraWebNavigator" tagprefix="ignav" %>

<%@ Register assembly="Infragistics2.WebUI.Misc.v8.2, Version=8.2.20082.1000, Culture=neutral, PublicKeyToken=7dd5c3163f2cd0cb" namespace="Infragistics.WebUI.Misc" tagprefix="igmisc" %>

<asp:Content ID="Content1" runat="server"

contentplaceholderid="ContentPlaceHolder1">

 

<script type="text/javascript">

function TemplateUpdateControls(gn,ctrlId,cellId,value)

{

if(ctrlId=="MaskEdit1")

{

igtbl_getElementById(ctrlId).Text=value;

return true;

}

else if(ctrlId=="PVDate1" || ctrlId=="PVDate2" || ctrlId=="PVDate3")

{

var d=new Date(value);

igtbl_getElementById(ctrlId).Value=(d.getMonth()+1).toString()+"/"+d.getDate()+"/"+d.getFullYear();

return true;

}

else if(ctrlId=="shipAddrId")

{

var s=value;

igtbl_getElementById(ctrlId).innerText=value;

return true;

}

else if(ctrlId=="tmplShipName")

{

igtbl_getElementById(
"tmplName").innerText=value;

}

}

function TemplateUpdateCells(gn,ctrlId,cellId)

{

if(ctrlId=="MaskEdit1")

{

igtbl_getCellById(cellId).setValue(igtbl_getElementById(ctrlId).TextWithMask);

return true;

}

else if(ctrlId=="PVDate1" || ctrlId=="PVDate2" || ctrlId=="PVDate3")

{

igtbl_getCellById(cellId).setValue(igtbl_getElementById(ctrlId).Value);

return true;

}

else if(ctrlId=="shipAddrId")

{

var s=igtbl_getElementById(ctrlId).innerText;

igtbl_getCellById(cellId).setValue(s);

return true;

}

}

function arto()

{

}

</script>

<table style="width: 100%">

<tr>

<td colspan="4">

<asp:Label ID="Label1" runat="server" CssClass="DescTitle"

Text="Currency Management" Font-Bold="True" Font-Size="Small"></asp:Label>

</td>

<td>

&nbsp;</td>

</tr>

<tr>

<td colspan="4">

<asp:ScriptManager ID="ScriptManager1" runat="server">

</asp:ScriptManager>

</td>

<td align="right">

<asp:ImageButton ID="imgBtnPrint" runat="server"

ImageUrl="~/Images/printer.gif" />

</td>

</tr>

<tr>

<td colspan="4">

<asp:UpdatePanel ID="UpdatePanel4" runat="server">

<ContentTemplate>

<asp:Label ID="lblMessage" runat="server" Font-Bold="True" ForeColor="#990000"></asp:Label>

</ContentTemplate>

</asp:UpdatePanel>

</td>

<td align="right">

&nbsp;</td>

</tr>

<tr>

<td>

<asp:Button ID="btnAddNewAbove" runat="server" CssClass="text_in_box"

Text="Add New" />

</td>

<td style="width: 84px" colspan="2">

<asp:UpdatePanel ID="UpdatePanel2" runat="server">

<ContentTemplate>

<asp:Button ID="btnDeleteAbove" runat="server" CssClass="text_in_box"

Text="Delete" Enabled="False" />

</ContentTemplate>

</asp:UpdatePanel>

</td>

<td style="width: 536px">

&nbsp;</td>

<td>

&nbsp;</td>

</tr>

<tr>

<td style="height: 8px;">

</td>

<td style="width: 84px; height: 8px;" colspan="2">

</td>

<td style="width: 536px; height: 8px;">

</td>

<td style="height: 8px">

</td>

</tr>

<tr>

<td colspan="4" style="height: 82px">

<asp:UpdatePanel ID="UpdatePanel1" runat="server">

<ContentTemplate>

<igtab:UltraWebTab ID="UltraWebTab1" runat="server"

Width="80%" ontabclick="UltraWebTab1_TabClick">

<Tabs>

<igtab:Tab Text="English" Tooltip="Enter Data in English Language">

<ContentTemplate>

<igtbl:UltraWebGrid ID="grdEnglishCurrencies" runat="server" Height="200px"

Width="80%" >

<DisplayLayout CompactRendering="False" StationaryMargins="HeaderAndFooter" AllowSortingDefault="Yes"

RowHeightDefault="20px" RowSizingDefault="Free" Version="2.00.5000"

SelectTypeRowDefault="Single" AllowColumnMovingDefault="OnServer" SelectTypeCellDefault="Extended"

BorderCollapseDefault="Separate" AllowColSizingDefault="Free" Name="UltraWebGrid1"

TableLayout="Fixed" CellClickActionDefault="RowSelect" AllowUpdateDefault="Yes"

AutoGenerateColumns="False">

<FrameStyle Width="100%" Cursor="Default" BorderWidth="1px" Font-Size="7pt" Font-Names="Verdana"

BorderStyle="Solid" BackColor="#E0E0E0" Height="338px">

</FrameStyle>

 

<ClientSideEvents AfterRowTemplateOpenHandler="arto" TemplateUpdateControlsHandler="TemplateUpdateControls"

TemplateUpdateCellsHandler="TemplateUpdateCells"></ClientSideEvents>

<Pager>

<PagerStyle BackColor="LightGray" BorderStyle="Solid" BorderWidth="1px">

<BorderDetails ColorLeft="White" ColorTop="White" WidthLeft="1px"

WidthTop="1px" />

</PagerStyle>

</Pager>

<EditCellStyleDefault BorderStyle="None" BorderWidth="0px">

</EditCellStyleDefault>

<FooterStyleDefault BorderWidth="1px" BorderStyle="Solid" BackColor="LightGray">

<BorderDetails ColorTop="White" WidthLeft="1px" WidthTop="1px" ColorLeft="White"></BorderDetails>

</FooterStyleDefault>

<HeaderStyleDefault VerticalAlign="Middle" BorderWidth="1px" BorderStyle="Solid"

HorizontalAlign="Left" BackColor="LightGray" Height="20px">

<Padding Left="3px" Right="3px"></Padding>

<BorderDetails ColorTop="White" WidthLeft="1px" ColorBottom="Gray" WidthTop="1px"

ColorRight="Gray" ColorLeft="White"></BorderDetails>

</HeaderStyleDefault>

<RowSelectorStyleDefault Width="16px" BorderStyle="Solid" BackColor="White">

<BorderDetails WidthLeft="0px" ColorBottom="224, 224, 224" WidthTop="0px" WidthRight="0px"

WidthBottom="1px"></BorderDetails>

</RowSelectorStyleDefault>

<RowStyleDefault TextOverflow="Ellipsis" VerticalAlign="Middle" BorderWidth="1px"

Font-Size="8pt" Font-Names="Verdana" BorderColor="LightGray" BorderStyle="Solid"

HorizontalAlign="Left" ForeColor="Black" BackColor="White">

<Padding Left="5px"></Padding>

<BorderDetails ColorTop="DimGray" WidthLeft="0px" WidthTop="0px" ColorLeft="DimGray">

</BorderDetails>

</RowStyleDefault>

<GroupByRowStyleDefault BackColor="Control" BorderColor="Window">

</GroupByRowStyleDefault>

<SelectedRowStyleDefault ForeColor="Black" BackColor="LightSteelBlue">

</SelectedRowStyleDefault>

<GroupByBox Hidden="True">

<BoxStyle BackColor="ActiveBorder" BorderColor="Window">

</BoxStyle>

</GroupByBox>

<AddNewBox>

<BoxStyle BackColor="Window" BorderColor="InactiveCaption" BorderStyle="Solid"

BorderWidth="1px">

<BorderDetails ColorLeft="White" ColorTop="White" WidthLeft="1px"

WidthTop="1px" />

</BoxStyle>

</AddNewBox>

<ActivationObject BorderStyle="None" BorderWidth="0px" AllowActivation="False">

</ActivationObject>

<FilterOptionsDefault>

<FilterDropDownStyle BackColor="White" BorderColor="Silver" BorderStyle="Solid"

BorderWidth="1px" CustomRules="overflow:auto;"

Font-Names="Verdana,Arial,Helvetica,sans-serif" Font-Size="11px" Height="300px"

Width="200px">

<Padding Left="2px" />

</FilterDropDownStyle>

<FilterHighlightRowStyle BackColor="#151C55" ForeColor="White">

</FilterHighlightRowStyle>

<FilterOperandDropDownStyle BackColor="White" BorderColor="Silver" BorderStyle="Solid" BorderWidth="1px" CustomRules="overflow:auto;"

Font-Names="Verdana,Arial,Helvetica,sans-serif" Font-Size="11px">

<Padding Left="2px" />

</FilterOperandDropDownStyle>

</FilterOptionsDefault>

</DisplayLayout>

<Bands>

<igtbl:UltraGridBand>

<Columns>

 

<igtbl:UltraGridColumn BaseColumnName="ID" Hidden="True">

<Header Caption="ID">

</Header>

</igtbl:UltraGridColumn>

 

<igtbl:TemplatedColumn Width="5%">

 

<CellTemplate>

<asp:CheckBox ID="chkSelect" runat="server"

oncheckedchanged="chkSelect_CheckedChanged" AutoPostBack="True" />

</CellTemplate>

<Header Caption="Select">

<RowLayoutColumnInfo OriginX="1" />

</Header>

<Footer>

<RowLayoutColumnInfo OriginX="1" />

</Footer>

 

</igtbl:TemplatedColumn>

<igtbl:UltraGridColumn AllowUpdate="Yes" BaseColumnName="Code" Width="5%">

<Header Caption="Title">

<RowLayoutColumnInfo OriginX="3" />

</Header>

<Footer>

<RowLayoutColumnInfo OriginX="3" />

</Footer>

</igtbl:UltraGridColumn>

<igtbl:UltraGridColumn AllowUpdate="Yes" BaseColumnName="Title" Width="10%">

<Header Caption="Code">

<RowLayoutColumnInfo OriginX="2" />

</Header>

<Footer>

<RowLayoutColumnInfo OriginX="2" />

</Footer>

</igtbl:UltraGridColumn>

<igtbl:UltraGridColumn Width="25%" AllowUpdate="Yes"

BaseColumnName="Description" CellMultiline="Yes">

<Header Caption="Description">

<RowLayoutColumnInfo OriginX="6" />

</Header>

<Footer>

<RowLayoutColumnInfo OriginX="6" />

</Footer>

</igtbl:UltraGridColumn>

 

<igtbl:UltraGridColumn AllowUpdate="Yes" BaseColumnName="Sign" Width="5%">

<Header Caption="Sign">

<RowLayoutColumnInfo OriginX="7" />

</Header>

 

<Footer>

<RowLayoutColumnInfo OriginX="7" />

</Footer>

 

</igtbl:UltraGridColumn>

<igtbl:UltraGridColumn AllowUpdate="Yes" BaseColumnName="Coin"

CellMultiline="Yes" Width="5%">

<Header Caption="Coin">

<RowLayoutColumnInfo OriginX="4" />

</Header>

<Footer>

<RowLayoutColumnInfo OriginX="4" />

</Footer>

 

</igtbl:UltraGridColumn>

<igtbl:UltraGridColumn Width="12%" AllowUpdate="Yes"

BaseColumnName="LeastDecValue">

<Header Caption="Least decimal Val">

<RowLayoutColumnInfo OriginX="5" />

</Header>

<Footer>

<RowLayoutColumnInfo OriginX="5" />

</Footer>

 

</igtbl:UltraGridColumn>

<igtbl:UltraGridColumn AllowUpdate="Yes" BaseColumnName="CalBasisDays"

Width="12%">

<Header Caption="Calc. Basis Days">

<RowLayoutColumnInfo OriginX="9" />

</Header>

<Footer>

<RowLayoutColumnInfo OriginX="9" />

</Footer>

</igtbl:UltraGridColumn>

<igtbl:UltraGridColumn Width="10%" AllowUpdate="Yes" BaseColumnName="ExchRate">

<Header Caption="Exch. Rate">

<RowLayoutColumnInfo OriginX="8" />

</Header>

<Footer>

<RowLayoutColumnInfo OriginX="8" />

</Footer>

</igtbl:UltraGridColumn>

<igtbl:TemplatedColumn BaseColumnName="DefCurrency" Format="#########"

Width="15%">

 

<CellTemplate>

<asp:CheckBox ID="chkDefaultCurrency" runat="server" AutoPostBack="True"

Enabled="False" oncheckedchanged="chkDefaultCurrency_CheckedChanged" />

</CellTemplate>

<Header Caption="Default Currency">

<RowLayoutColumnInfo OriginX="10" />

</Header>

<Footer>

<RowLayoutColumnInfo OriginX="10" />

</Footer>

</igtbl:TemplatedColumn>

</Columns>

<RowEditTemplate>

 

<div style="padding: 2px; font-size: 8pt; width: 65%; font-family: Verdana; height: 35px; background-color: cornsilk">

Details For Currency:

<div id="tmplName" style="font-weight: bold">

Name</div>

</div>

<table cellspacing="5" cellpadding="0" border="0" style="width: 100%">

<tr>

<td valign="top" bgcolor="white" style="border-right: #000000 1px solid; border-top: #000000 1px solid;

border-left: #000000 1px solid; border-bottom: #000000 1px solid">

<table cellspacing="5" cellpadding="0" width="100%" border="0">

<tbody>

<tr>

<td style="font-size: 8pt; font-family: Verdana" align="left">

</td>

</td>

</tr>

<tr>

<td style="font-size: 8pt; font-family: Verdana" align="left">

Code:<br>

<asp:TextBox ID="TextBox1" runat="server" Font-Size="8pt" Width="190px" columnKey="Code"

Font-Name="Verdana" Font-Names="Verdana" Text='<%# Eval("Code") %>'></asp:TextBox></td>

</tr>

<tr>

<td style="font-size: 8pt; font-family: Verdana" align="left">

title:<br>

<asp:TextBox ID="TextBox2" runat="server" Font-Size="8pt" Width="190px" columnKey="Title"

Font-Name="Verdana" Font-Names="Verdana" Text='<%# Eval("Title") %>'></asp:TextBox></td>

</tr>

<tr>

<td style="font-size: 8pt; font-family: Verdana" align="left">

Sign:<br>

<asp:TextBox ID="TextBox3" runat="server" Font-Size="8pt" Width="190px" columnKey="Sign"

Font-Name="Verdana" Font-Names="Verdana" Text='<%# Eval("Sign") %>'></asp:TextBox></td>

</tr>

</table>

<td bgcolor="white" style="border-right: #000000 1px solid; border-top: #000000 1px solid;

border-left: #000000 1px solid; border-bottom: #000000 1px solid">

<table cellspacing="5" cellpadding="0" border="0">

<tr>

<td style="font-size: 8pt; font-family: Verdana" align="right">

Coin:</td>

<td>

<asp:TextBox ID="TextBox4" runat="server" Font-Size="8pt"

Text='<%# Eval("Coin") %>'></asp:TextBox>

&nbsp;</td>

</tr>

<tr>

<td style="font-size: 8pt; font-family: Verdana" valign="top" align="right">

Description:</td>

<td>

<asp:TextBox ID="TextBox5" runat="server" Text='<%# Eval("Description") %>'

TextMode="MultiLine"></asp:TextBox>

&nbsp;</td>

</tr>

<tr>

<td style="font-size: 8pt; font-family: Verdana" align="right">

Ship City:</td>

<td>

<input style="font-size: 8pt; width: 125px; font-family: Verdana" type="text" size="22"

columnkey="ShipCity">

</td>

</tr>

<tr>

<td style="font-size: 8pt; font-family: Verdana" align="right">

Ship region:</td>

<td>

<input style="font-size: 8pt; width: 125px; font-family: Verdana" type="text" size="10"

columnkey="ShipRegion">

</td>

</tr>

<tr>

<td style="font-size: 8pt; font-family: Verdana" align="right">

Ship Postal Code:</td>

<td>

<input style="font-size: 8pt; width: 125px; font-family: Verdana" type="text" size="10"

columnkey="ShipPostalCode">

</td>

</tr>

<tr>

<td style="font-size: 8pt; font-family: Verdana" align="right">

Ship Country:</td>

<td>

<input style="font-size: 8pt; width: 125px; font-family: Verdana" type="text" size="10"

columnkey="ShipCountry">

</td>

</tr>

</table>

</td>

<caption>

<br>

<input ID="igtbl_reOkBtn" onclick="igtbl_gRowEditButtonClick(event);" style="font-size: 8pt; width: 75px; font-family: Verdana;

background-color: lightsteelblue" type="button" value="OK">&nbsp;&nbsp;

<input ID="igtbl_reCancelBtn" onclick="igtbl_gRowEditButtonClick(event);" style="font-size: 8pt; width: 75px; font-family: Verdana;

background-color: darkseagreen" type="button" value="Cancel">

 

</caption>

</RowEditTemplate>

<RowTemplateStyle BackColor="Window" BorderColor="Window" BorderStyle="Ridge">

<BorderDetails WidthBottom="3px" WidthLeft="3px" WidthRight="3px"

WidthTop="3px" />

</RowTemplateStyle>

<AddNewRow View="NotSet" Visible="NotSet">

</AddNewRow>

</igtbl:UltraGridBand>

</Bands>

</igtbl:UltraWebGrid>

</ContentTemplate>

</igtab:Tab>

<igtab:Tab Text="Arabic" Tooltip="Enter Data in Arabic Language">

<ContentTemplate>

<igtbl:UltraWebGrid ID="grdArabicCurrencies" runat="server" Height="200px"

Width="325px">

<bands>

<igtbl:UltraGridBand>

<addnewrow view="NotSet" visible="NotSet">

</addnewrow>

</igtbl:UltraGridBand>

</bands>

<displaylayout allowcolsizingdefault="Free" allowcolumnmovingdefault="OnServer"

allowdeletedefault="Yes" allowsortingdefault="OnClient"

allowupdatedefault="Yes" bordercollapsedefault="Separate"

headerclickactiondefault="SortMulti" name="UltraWebGrid1"

rowheightdefault="20px" rowselectorsdefault="No"

selecttyperowdefault="Extended" stationarymargins="Header"

stationarymarginsoutlookgroupby="True" tablelayout="Fixed" version="4.00"

viewtype="OutlookGroupBy">

<framestyle backcolor="Window" bordercolor="InactiveCaption" borderstyle="Solid" borderwidth="1px" font-names="Microsoft Sans Serif"

font-size="8.25pt" height="200px" width="325px">

</framestyle>

<pager minimumpagesfordisplay="2">

<PagerStyle BackColor="LightGray" BorderStyle="Solid" BorderWidth="1px">

<borderdetails colorleft="White" colortop="White" widthleft="1px"

widthtop="1px" />

</PagerStyle>

</pager>

<editcellstyledefault borderstyle="None" borderwidth="0px">

</editcellstyledefault>

<footerstyledefault backcolor="LightGray" borderstyle="Solid" borderwidth="1px">

<borderdetails colorleft="White" colortop="White" widthleft="1px"

widthtop="1px" />

</footerstyledefault>

<headerstyledefault backcolor="LightGray" borderstyle="Solid"

horizontalalign="Left">

<borderdetails colorleft="White" colortop="White" widthleft="1px"

widthtop="1px" />

</headerstyledefault>

<rowstyledefault backcolor="Window" bordercolor="Silver" borderstyle="Solid"

borderwidth="1px" font-names="Microsoft Sans Serif" font-size="8.25pt">

<padding left="3px" />

<borderdetails colorleft="Window" colortop="Window" />

</rowstyledefault>

<groupbyrowstyledefault backcolor="Control" bordercolor="Window">

</groupbyrowstyledefault>

<groupbybox>

<boxstyle backcolor="ActiveBorder" bordercolor="Window">

</boxstyle>

</groupbybox>

<addnewbox hidden="False">

<boxstyle backcolor="Window" bordercolor="InactiveCaption" borderstyle="Solid"

borderwidth="1px">

<borderdetails colorleft="White" colortop="White" widthleft="1px"

widthtop="1px" />

</boxstyle>

</addnewbox>

<activationobject bordercolor="" borderwidth="">

</activationobject>

<filteroptionsdefault>

<filterdropdownstyle backcolor="White" bordercolor="Silver" borderstyle="Solid"

borderwidth="1px" customrules="overflow:auto;"

font-names="Verdana,Arial,Helvetica,sans-serif" font-size="11px" height="300px"

width="200px">

<padding left="2px" />

</filterdropdownstyle>

<filterhighlightrowstyle backcolor="#151C55" forecolor="White">

</filterhighlightrowstyle>

<filteroperanddropdownstyle backcolor="White" bordercolor="Silver" borderstyle="Solid" borderwidth="1px" customrules="overflow:auto;"

font-names="Verdana,Arial,Helvetica,sans-serif" font-size="11px">

<padding left="2px" />

</filteroperanddropdownstyle>

</filteroptionsdefault>

</displaylayout>

</igtbl:UltraWebGrid>

</ContentTemplate>

</igtab:Tab>

</Tabs>

</igtab:UltraWebTab>

</ContentTemplate>

<Triggers>

<asp:AsyncPostBackTrigger ControlID="btnAddNewAbove" EventName="Click" />

<asp:AsyncPostBackTrigger ControlID="btnDeleteAbove" EventName="Click" />

<asp:AsyncPostBackTrigger ControlID="btnAddNewBelow" />

<asp:AsyncPostBackTrigger ControlID="btnDeleteBelow" />

</Triggers>

</asp:UpdatePanel>

</td>

<td style="height: 82px">

</td>

</tr>

<tr>

<td colspan="4" style="height: 30px">

</td>

<td style="height: 30px">

</td>

</tr>

<tr>

<td>

<asp:Button ID="btnAddNewBelow" runat="server" CssClass="text_in_box"

Text="Add New" />

</td>

<td>

<asp:UpdatePanel ID="UpdatePanel3" runat="server">

<ContentTemplate>

<asp:Button ID="btnDeleteBelow" runat="server" CssClass="text_in_box"

Text="Delete" Enabled="False" />

</ContentTemplate>

</asp:UpdatePanel>

</td>

<td colspan="2">

&nbsp;</td>

<td>

&nbsp;</td>

</tr>

</table> </asp:Content>

 

Parents
No Data
Reply
  • 28464
    posted

    Hello,

    I was able to reproduce the same problem locally. It seems that if you are manually binding the grid (e.g. not using declarative datasources), you need to bind the grid very early in the page life-cycle in order to avoid the exception you are getting - you need to re-bind the grid in the Page_Init (OnInit event of the Page) event handler. You can also try using the InitializeDataSource event of the grid - it gets automatically called when datasource is needed and my actually be the better solution. Moving my binding code to OnInit solved the problem in my case, hopefully this approach is applicable in your case as well, or you can try InitializeDataSource as well.

    You can find a related thread with this and other suggestions that helped here:

    http://forums.infragistics.com/forums/p/3026/17064.aspx

    I also recommend the following blog post for additional information how databinding in UltraWebGrid works in general:

    http://blogs.infragistics.com/blogs/tony_lombardo/archive/2008/01/29/demystifying-infragistics-webgrid-databinding.aspx 

    Please, let me know if this helps.

     

Children