저는 금액이 0
또는 ""
인 경우 원하는 내용이 Gridview
입니다. 송장 생성 버튼을 숨기고 싶습니다. 내가Gridview 행이 null이거나 객체가 아닙니다.
Microsoft JScript runtime error: 'GridExpInfo.Rows[...].Cells.14.style' is null or not an object
으로 오류를 얻고있다
function GridExpInfo_ClientInsert() {
for (i = 0; i < GridExpInfo.Rows.length; i++) {
if (GridExpInfo.Rows[i].Cells[7].Value == "" || GridExpInfo.Rows[i].Cells[7].Value == "0") {
GridExpInfo.Rows[i].Cells[14].style.display = "none";
}
}
}
, I는 시도 그 무엇에 대한 그래서하지만 여기 내 gridview
영문 혼합하지 마십시오
<cc1:Grid ID="GridExpInfo" runat="server" FolderStyle="../Styles/Grid/style_12" AutoGenerateColumns="false"
AllowAddingRecords="true" AllowColumnResizing="true" Width="100%" ShowFooter="true"
ShowHeader="true" OnInsertCommand="GridExpInfo_InsertCommand" OnRebind="GridExpInfo_Rebind"
OnRowDataBound="GridExpInfo_RowDataBound" OnUpdateCommand="GridExpInfo_UpdateCommand">
<ClientSideEvents OnClientAdd="GridExpInfo_ClientAdd" OnClientEdit="GridExpInfo_OnClientEdit"
OnClientDblClick="GridExpInfo_OnClientDblClick" OnClientInsert="GridExpInfo_ClientInsert" />
<TemplateSettings RowEditTemplateId="tplRowEdit3" />
<Columns>
<cc1:Column ID="Column19" DataField="MKEY" ReadOnly="true" Width="0%" runat="server"
Visible="false">
<TemplateSettings TemplateId="gtchkConfirm" HeaderTemplateId="HTConfirm" />
</cc1:Column>
<cc1:Column Wrap="true" DataField="SR_NO" ReadOnly="true" HeaderText="Sr No" Width="4%"
ID="Column31">
<TemplateSettings RowEditTemplateControlId="txtsrnoexp" RowEditTemplateControlPropertyName="value" />
</cc1:Column>
<cc1:Column Wrap="true" DataField="TYPE" HeaderText="Agreement Type" Width="8%" ID="Column51">
<TemplateSettings RowEditTemplateControlId="ddlTypeExpData" RowEditTemplateControlPropertyName="value" />
</cc1:Column>
<cc1:Column Wrap="true" DataField="STAGE" HeaderText="Stage" Width="8%" ID="Column44">
<TemplateSettings RowEditTemplateControlId="ddlStageType" RowEditTemplateControlPropertyName="value" />
</cc1:Column>
<cc1:Column Wrap="true" DataField="EXP_TYPE" HeaderText="Expense Type" Width="8%"
ID="Column25">
<TemplateSettings RowEditTemplateControlId="ddlexptypExp" RowEditTemplateControlPropertyName="value" />
</cc1:Column>
<cc1:Column Wrap="true" DataField="EXP_ID" Width="0%" Visible="false" ID="Column43">
</cc1:Column>
<cc1:Column Wrap="true" DataField="PARTY_NAME" HeaderText="Party Name" Width="8%"
ID="Column29">
<TemplateSettings RowEditTemplateControlId="txtpartynameexp" RowEditTemplateControlPropertyName="value" />
</cc1:Column>
<cc1:Column Wrap="true" DataField="AMOUNT" HeaderText="Amount" Width="6%" ID="Column21">
<TemplateSettings RowEditTemplateControlId="txtamountexp" RowEditTemplateControlPropertyName="value" />
</cc1:Column>
<cc1:Column Wrap="true" DataField="REMARKS" HeaderText="Remarks" Width="10%" ID="Column24">
<TemplateSettings RowEditTemplateControlId="txtremexp" RowEditTemplateControlPropertyName="value" />
</cc1:Column>
<cc1:Column Wrap="true" DataField="CHQ_FAVR_NAME" HeaderText="Chq in Favor Name"
Width="8%" ID="Column28">
<TemplateSettings RowEditTemplateControlId="txtchqfavExp" RowEditTemplateControlPropertyName="value" />
</cc1:Column>
<cc1:Column Wrap="true" DataField="VOUCHER_NO" HeaderText="Voucher No" Width="6%"
ID="Column26">
<TemplateSettings RowEditTemplateControlId="txtvouchexp" RowEditTemplateControlPropertyName="value" />
</cc1:Column>
<cc1:Column Wrap="true" DataField="CHEQUE_NO" HeaderText="Chq No" Width="5%" ID="Column27">
<TemplateSettings RowEditTemplateControlId="txtChqnoExp" RowEditTemplateControlPropertyName="value" />
</cc1:Column>
<cc1:Column Wrap="true" DataField="CHEQUE_DT" DataFormatString="{0:dd-MM-yyyy}" HeaderText="Chq Date"
Width="6%" ID="Column30">
<TemplateSettings RowEditTemplateControlId="txtchqDtExp" RowEditTemplateControlPropertyName="value" />
</cc1:Column>
<cc1:Column ID="Column32" DataField="ATTACHMENT" HeaderText="Attachment" runat="server"
Width="8%" Wrap="true">
</cc1:Column>
<cc1:Column ID="Column20" HeaderText="Generate Invoice" runat="server" Width="8%"
Wrap="true">
<TemplateSettings TemplateId="tplButtonInvoice" />
</cc1:Column>
</Columns>
<Templates>
<cc1:GridTemplate runat="server" ID="tplRowEdit3">
<Template>
<table class="rowEditTable">
<tr>
<td valign="top">
<fieldset style="width: 750px; height: 310px;">
<legend>Expense Information</legend>
<table cellpadding="2" cellspacing="2" border="0">
<tr>
<td style="display: none;">
SR NO :
</td>
<td>
<input type="text" runat="server" id="txtsrnoexp" style="display: none;" class="ob_gEC" />
</td>
</tr>
<tr>
<td>
Type :
</td>
<td>
<asp:DropDownList ID="ddlTypeExpData" runat="server" Width="250px" DataSourceID="ds_exp_type"
DataTextField="TYPE_DESC" DataValueField="TYPE_DESC">
<asp:ListItem Value="0">--Select--</asp:ListItem>
<%--<asp:ListItem Value="Agreement Type">Agreement Type</asp:ListItem>
<asp:ListItem Value="Expense Type">Expense Type</asp:ListItem>--%>
</asp:DropDownList>
</td>
</tr>
<tr>
<td>
Stage :
</td>
<td>
<asp:DropDownList ID="ddlStageType" runat="server" name="ddlStageTypename" DataSourceID="sd_Type_Stage"
DataTextField="STAGE" DataValueField="STAGE" Width="250px">
</asp:DropDownList>
</td>
</tr>
<tr style="display: none;">
<td>
Ref No :
</td>
<td>
<%--<input type="text" id="txtExpRefNo" name="txtrefNovalue" runat="server" style="width: 150px;
height: 18px; font-size: 11px;" class="ob_gEC" />--%>
<asp:TextBox ID="txtExpRefNo" Height="18px" name="txtrefNovalue" runat="server" CssClass="ob_gEC"
Width="150px"></asp:TextBox>
</td>
<td>
Ref Date :
</td>
<td>
<%-- <input type="text" id="txtExpRefDt" name="txtrefdatevalue" runat="server" style="width: 150px;
height: 18px; font-size: 11px;" class="ob_gEC" />--%>
<asp:TextBox ID="txtExpRefDt" Height="18px" name="txtExpRefDt" runat="server" CssClass="ob_gEC"
Width="150px"></asp:TextBox>
</td>
</tr>
<tr>
<td>
Expense Type:
</td>
<td>
<asp:DropDownList ID="ddlexptypExp" runat="server" DataSourceID="sd_Type_EXP" DataTextField="DESCRIPTION"
DataValueField="DESCRIPTION" Width="250px">
<asp:ListItem Value="--Select--">--Select--</asp:ListItem>
</asp:DropDownList>
</td>
</tr>
<tr>
<td>
Amount:
</td>
<td>
<input type="text" id="txtamountexp" style="width: 150px; height: 18px; font-size: 11px;"
class="ob_gEC" />
</td>
</tr>
<tr>
<td>
Party Name:
</td>
<td>
<input type="text" id="txtpartynameexp" style="width: 250px; height: 18px; font-size: 11px;"
class="ob_gEC" />
</td>
</tr>
<tr>
<td>
Expense Details:
</td>
<td>
<asp:TextBox ID="txtremexp" CssClass="ob_gEC" runat="server" Width="250px" Height="50"
TextMode="MultiLine" Style="font-size: 11px;"></asp:TextBox>
</td>
</tr>
<tr>
<td>
Chq in favor name:
</td>
<td>
<input type="text" id="txtchqfavExp" style="width: 250px; height: 18px; font-size: 11px;"
class="ob_gEC" />
</td>
<td>
Voucher No:
</td>
<td>
<input type="text" id="txtvouchexp" style="width: 150px; height: 18px; font-size: 11px;"
class="ob_gEC" />
</td>
</tr>
<tr>
<td>
Chq No:
</td>
<td>
<input type="text" id="txtChqnoExp" style="width: 150px; height: 18px; font-size: 11px;"
class="ob_gEC" />
</td>
<td>
Chq date:
</td>
<td>
<input type="text" id="txtchqDtExp" style="width: 150px; height: 18px; font-size: 11px;"
class="ob_gEC" />
</td>
</tr>
<tr>
<td>
Attachment:
</td>
<td>
<input type="file" id="FlAttacExp" style="width: 300px; height: 18px; font-size: 11px;"
class="ob_gEC" />
</td>
</tr>
</table>
</fieldset>
</td>
</tr>
<tr>
<td colspan="2" align="center">
<input type="button" value="Save" onclick="GridExpInfo.save()" class="button" />
<input type="button" value="Cancel" onclick="GridExpInfo.cancel()" class="button" />
</td>
</tr>
</table>
</Template>
</cc1:GridTemplate>
</Templates>
<%-- <Templates>
<cc1:GridTemplate runat="server" ID="tplNumbering3">
<Template>
<b>
<%# (Container.RecordIndex + 1) %></b>
</Template>
</cc1:GridTemplate>
</Templates>--%>
<Templates>
<cc1:GridTemplate runat="server" ID="tplButtonInvoice">
<Template>
<input id="Button1" type="button" runat="server" value="Invoice" style="width: 80px;" />
</Template>
</cc1:GridTemplate>
</Templates>
</cc1:Grid>
당신의 첫번째 대답에 아래 코드를 붙여 넣습니다
GridView
아래 아주 동일한 샘플을 참조하십시오 나를 위해 일하지 않습니다. 또한 두 번째 대답을 위해 무엇을 추가해야합니까? string.IsNullOrEmpty (Eval ("value") .ToString()'. 내 조건은 값이 '0' 또는'' "'이면 숨기려고합니다 – BNN내 대답 업데이트 – VDWWD
'DataBinding : 'System.Collections.Hashtable'에 'value'라는 이름의 속성이 없습니다. ' – BNN