Академический Документы
Профессиональный Документы
Культура Документы
AutoGenerateColumns="False" ShowFooter="True"
OnRowUpdating="grdTaxMaster_RowUpdating"
OnRowCommand="grdTaxMaster_RowCommand"
OnRowEditing="grdTaxMaster_RowEditing"
OnRowCancelingEdit="grdTaxMaster_RowCancelingEdit" AllowPaging="True"
OnPageIndexChanging="grdTaxMaster_PageIndexChanging"
<Columns>
<ItemTemplate>
Bind("TAX_CODE") %>'></asp:Label>
</ItemTemplate>
<EditItemTemplate>
</asp:TextBox>
</EditItemTemplate>
<FooterTemplate>
runat="server"></asp:TextBox>
</FooterTemplate>
</asp:TemplateField>
<asp:TemplateField HeaderText="Status">
<ItemTemplate>
<EditItemTemplate>
<FooterTemplate>
</FooterTemplate>
<FooterStyle HorizontalAlign="Center" />
</asp:TemplateField>
<asp:TemplateField ShowHeader="False">
<FooterTemplate>
</FooterTemplate>
</asp:TemplateField>
</Columns
ForeColor="#333333" />
</asp:GridView>
Code:
if (dsTaxMaster.Tables[0].Rows.Count > 0)
{
grdTaxMaster.DataSource=dsTaxMaster.Tables[0];
grdTaxMaster.DataBind();
grdTaxMaster.Columns[grdTaxMaster.Columns.Count - 1].Visible =
true;
}
else
{
grdTaxMaster.DataSource = dtTable;
grdTaxMaster.DataBind();
grdTaxMaster.Rows[0].Cells[4].Controls[1].Visible = false;
}
}
#endregion
#endregion
#endregion
Convert.ToInt32(grdTaxMaster.DataKeys[e.RowIndex].Value.ToString());
TextBox txtTaxCode =
(TextBox)grdTaxMaster.Rows[e.RowIndex].FindControl("txtTaxCode");
TextBox txtTaxName =
(TextBox)grdTaxMaster.Rows[e.RowIndex].FindControl("txtTaxName");
TextBox txtTaxPercentage =
(TextBox)grdTaxMaster.Rows[e.RowIndex].FindControl("txtTaxPercentage");
CheckBox chkTaxStatus =
(CheckBox)grdTaxMaster.Rows[e.RowIndex].FindControl("chkTaxStatus");
//
BindAllTaxData();
}
#endregion
if (e.CommandName == "Add")
{
TextBox txtFooterTaxCode =
(TextBox)grdTaxMaster.FooterRow.FindControl("txtFooterTaxCode");
TextBox txtFooterTaxName =
(TextBox)grdTaxMaster.FooterRow.FindControl("txtFooterTaxName");
TextBox txtFooterTaxPercentage =
(TextBox)grdTaxMaster.FooterRow.FindControl("txtFooterTaxPercentage");
CheckBox chkTaxStatus =
(CheckBox)grdTaxMaster.FooterRow.FindControl("chkFooterTaxStatus");
//…… …
//……….
//
BindAllTaxData();
#endregion