devexpress - ASPxGridview undefined -
i have basic 1 table grid. have field called branch type. branch type can corporate or franchise. when click on edit button on aspxgridview row , display , hide fields on edit form, depending on branch type is. if corporate display manager field , hide owner field. when branch type franchise owner field displayed , manager field hidden on edit form. details can show on grid view on edit form force user fill in applicable fields.
if below:
this want achieve on loading edit form :
protected void aspxgridviewstores_celleditorinitialize(object sender, aspxgridvieweditoreventargs e) { if (!aspxgridviewstores.isediting || e.column.fieldname != "storeownershipid") return; if(e.keyvalue == dbnull.value || e.keyvalue == null) return; object val = aspxgridviewstores.getrowvaluesbykeyvalue(e.keyvalue, "s_id"); if(val == dbnull.value) return; int storeownershipid = (int32)val; if (storeownershipid == 4) { aspxcombobox managerid = (aspxcombobox)aspxgridviewstores.findeditformtemplatecontrol("managerid"); managerid.enabled = true; aspxcombobox contactid = (aspxcombobox)aspxgridviewstores.findeditformtemplatecontrol("contactid"); managerid.enabled = true; } else { aspxcombobox managerid = (aspxcombobox)aspxgridviewstores.findeditformtemplatecontrol("managerid"); managerid.enabled = false; aspxcombobox contactid = (aspxcombobox)aspxgridviewstores.findeditformtemplatecontrol("contactid"); managerid.enabled = false; } }
and depending on selecting corporate or franchise in "storeownershipid" field use client side script enable or disable additional fields.
i have done research well, , came following code:
selectedindexchanged="function(s, e) { var value = s.getvalue(); if(value == 4) gridviewstores.geteditor("ownername").setvisible(true); else gridviewstores.geteditor("ownername").setvisible(false); }"
but when called following error:
microsoft jscript runtime error: 'gridviewstores' undefined
i have added httphandler in web.config:
<httpmodules> <add type="devexpress.web.aspxclasses.aspxhttphandlermodule, devexpress.web.v10.2, version=10.2.4.0, culture=neutral, publickeytoken=b88d1754d700e49a" name="aspxhttphandlermodule" /> </httpmodules>
and
<system.webserver> <modules> <add type="devexpress.web.aspxclasses.aspxhttphandlermodule, devexpress.web.v10.2, version=10.2.4.0, culture=neutral, publickeytoken=b88d1754d700e49a" name="aspxhttphandlermodule" /> </modules>
as can see below have inserted clientinstancename,
i have changed clientidmode autoid inherit static predictable , each scenario not work , still renderes : microsoft jscript runtime error: 'aspxgridview' undefined.
below gridview tag
<dx:aspxgridview id="aspxgridview" runat="server" autogeneratecolumns="false" clientidmode="predictable" datasourceid="sqldatasource1" keyfieldname="s_id" clientinstancename="aspxgridview">
i have tried creating new page sqldatasource , gridview storetype field acombobox , including javascript mentioned in previous posts.. , no luck @ all. have given web.config settings declared httphandler, else suggest working?
here webconfig:
section enables configuration of security authentication mode used asp.net identify incoming user. --> section enables configuration of if/when unhandled error occurs during execution of request. specifically, enables developers configure html error pages displayed in place of error stack trace.
<customerrors mode="remoteonly" defaultredirect="genericerrorpage.htm"> <error statuscode="403" redirect="noaccess.htm" /> <error statuscode="404" redirect="filenotfound.htm" /> </customerrors> --> <httpmodules> <add type="devexpress.web.aspxclasses.aspxhttphandlermodule, devexpress.web.v10.2, version=10.2.4.0, culture=neutral, publickeytoken=b88d1754d700e49a" name="aspxhttphandlermodule" /> </httpmodules> <httphandlers> <add type="devexpress.web.aspxclasses.aspxhttphandlermodule, devexpress.web.v10.2, version=10.2.4.0, culture=neutral, publickeytoken=b88d1754d700e49a" verb="get" path="dx.ashx" validate="false" /> </httphandlers> <pages controlrenderingcompatibilityversion="3.5" clientidmode="autoid" />
sorry looong question. way using devexpress gridview. guys devexpress cant me , tak 1 day answer question, been going on week now...
thank werner
the java script case sensitive language. so, if clientinstancename set aspxgridview, code should be:
aspxgridview.geteditor("ownername").setvisible(true);
i see error message contains 'aspxgridview;' identifier. means code contains aspxgridview identifier should use aspxgridview (based on mark up). also, believe code wrong:
if (storeownershipid == 4) { aspxcombobox managerid = (aspxcombobox)aspxgridviewstores.findeditformtemplatecontrol("managerid"); managerid.enabled = true; aspxcombobox contactid = (aspxcombobox)aspxgridviewstores.findeditformtemplatecontrol("contactid"); managerid.enabled = true; } else { aspxcombobox managerid = (aspxcombobox)aspxgridviewstores.findeditformtemplatecontrol("managerid"); managerid.enabled = false; aspxcombobox contactid = (aspxcombobox)aspxgridviewstores.findeditformtemplatecontrol("contactid"); managerid.enabled = false; }
you set enabled property of managerid object twice same value. please check it. have nothing add. if not help, please let me know support center ticket id , if possible attach source code of page (cs , aspx) , web.config there. try you.
update: have found question in support center , answered it. hope, helps.
Comments
Post a Comment