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
115
Web Data Grid Is not working with WebAsyncRefreshPanel
posted

Hi I am using web data grid with webAsyncRefreshPanel

I have assigned datasource to grid inside content refreshevent

I am getting below error

Microsoft JScript runtime error: Sys.InvalidOperationException: Two components with the same id 'webNWGrid' can't be added to the application.

Can anybody facing the same issue?

Please help me out to fix this issue

 

cs page code

protected

 

void wrappnlGrid_ContentRefresh(object sender, EventArgs e)

{

 

if (hdnSaveOrBuild.Value == "BuildGrid")

{

 

int AccountId = Convert.ToInt32(ddlAccounts.SelectedValue);

 

int YearId = Convert.ToInt32(ddlYear.SelectedValue);

 

int VersionId = Convert.ToInt32(ddlVersion.SelectedValue);

 

int DimensionId = Convert.ToInt32(ddlDimension.SelectedValue);

 

int UnitId = Convert.ToInt32(ddlUnit.SelectedValue);

 

string Template = ddlTemplate.SelectedValue;

 

string IdList = string.Empty;

 

if (ddlTemplate.SelectedValue == "Account")

{

IdList = hdnEntityValue.Value;

}

 

else if (ddlTemplate.SelectedValue == "Unit")

{

IdList = hdnAccountValue.Value;

}

 

bool IsTotalVisible = chkShowTotal.Checked;

 

 

DataTable dtGrid = null;

dtGrid = GetData(AccountId, YearId, VersionId, DimensionId, UnitId, Template, IdList);

 

//CreateTable(dtGrid);

webNWGrid.ClearDataSource();

webNWGrid.DataSource = dtGrid;

webNWGrid.DataBind();

}

}

ASPX Page

 

<

 

script  type ="text/javascript">

 

 

 

 

function

 

BuildGrid(SaveOrBuild)

{

 

var hdnSaveOrBuild=document.getElementById('hdnSaveOrBuild')

 

if(hdnSaveOrBuild!=null)

{

hdnSaveOrBuild.value=SaveOrBuild;

}

 

var AccountID=document.getElementById('ddlAccounts').value;

 

var YearID=document.getElementById('ddlYear').value;

 

var VersionId=document.getElementById('ddlVersion').value;

 

var DimensionId=document.getElementById('ddlDimension').value;

 

var UnitId=document.getElementById('ddlUnit').value;

 

var Template=document.getElementById('ddlTemplate').value;

 

var IsTotalVisible= document.getElementById('chkShowTotal').checked;

 

var IdList;

 

if(Template=='Unit')

{

 

 

//IdList=document.getElementById('ob_cboAccountHidden').value;//cboAccount.getValue();

IdList=document.getElementById(

"txtAccount").getAttribute('ids');

 

//alert('IdList');

 

var hidden = document.getElementById('hdnAccountValue');

 

if (hidden != null)

{

hidden.value = IdList;

}

 

}

 

else

{

 

//alert('UnitA');

 

//IdList=document.getElementById('ob_cboEntityHidden').value;//cboEntity.getValue();

IdList=document.getElementById(

"txtEntity").getAttribute('ids');

 

var hidden = document.getElementById('hdnEntityValue');

 

if (hidden != null)

{

hidden.value = IdList;

}

}

 

var warp = ig$("wrappnlGrid");

 

//alert(warp);

 

if(!warp)

{

 

return;

}

warp.refresh();

}

</script

>

 

 

 

 

 

 

<tr

>

 

 

<td class="formLabelsNew" colspan="3" style

="text-align: center;">

 

 

<input id="btnBuildSheet" type="submit" value="Build Grid" validationgroup="NWS" class="button_white" language="javascript" onclick="BuildGrid('BuildGrid')" tabindex="11" />

&nbsp;

 

 

</td

>

 

 

</tr

>

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

<igmisc:WebAsyncRefreshPanel ID="wrappnlGrid" runat="server" TriggerPostBackIDs="webNWGrid" OnContentRefresh

="wrappnlGrid_ContentRefresh">

 

 

<ig:WebDataGrid ID="webNWGrid" runat="server" Height="350px" Width

="100%">

 

 

<Behaviors

>

 

 

<ig:EditingCore

>

 

 

<Behaviors

>

 

 

<ig:CellEditing Enabled="true" EditModeActions-MouseClick

="Single">

 

 

<ColumnSettings

>

 

 

<ig:EditingColumnSetting ColumnKey="Account" ReadOnly="true"

/>

 

 

<ig:EditingColumnSetting ColumnKey="Can Update" ReadOnly="true"

/>

 

 

</ColumnSettings

>

 

 

</ig:CellEditing

>

 

 

</Behaviors

>

 

 

</ig:EditingCore

>

 

 

<ig:Paging PageSize="10" PagerAppearance="Bottom"

/>

 

 

</Behaviors

>

 

 

</ig:WebDataGrid

>

 

 

</igmisc:WebAsyncRefreshPanel

>


 

Parents
No Data
Reply
  • 22852
    Offline posted

    Hello,

    The Microsoft AJAX Update Panel should be used in place of the WebAsyncRefreshPanel when using any of the ASP.NET AJAX controls.  The following is from the known issues in the help:

    "In order to maximize performance and compatibility, the Infragistics ASP.NET AJAX web controls should not be used together with the NetAdvantage ASP.NET WebAsyncRefreshPanel; instead, it is suggested that you use the Microsoft ASP.NET AJAX Update Panel. The performance and compatibility gain is a result of the Infragistics ASP.NET AJAX controls and the Update Panel both being built upon the Microsoft AJAX Extensions which allows both to excel together due to their commonly shared code base. "

    Let me know if you have any questions with this matter.

Children
No Data