TECHNOLOGIES
FORUMS
JOBS
BOOKS
EVENTS
INTERVIEWS
Live
MORE
LEARN
Training
CAREER
MEMBERS
VIDEOS
NEWS
BLOGS
Sign Up
Login
No unread comment.
View All Comments
No unread message.
View All Messages
No unread notification.
View All Notifications
Answers
Post
An Article
A Blog
A News
A Video
An EBook
An Interview Question
Ask Question
Forums
Monthly Leaders
Forum guidelines
kuldeep singh
NA
56
16.1k
How to align(left,right,center..) textbox data in form view
Jul 3 2015 6:41 AM
Hi friends
i am showing data in formview but it is showing it left aligned by default .....can i change this alignment to right ?
If yes please help how to do that because normal style is not working on it..
my code
<%@ Page Language="C#" AutoEventWireup="true" CodeFile="test.aspx.cs" Inherits="test" %>
<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
<style type="text/css">
.alg
{
text-align:right;
}
</style>
<title></title>
</head>
<body style="height: 591px; margin-left: 275px">
<form id="form1" runat="server">
<div style="margin-left: 0px">
<br />
<asp:Panel ID="Panel2" runat="server" style="margin-left: 297px" BackColor="White" BorderStyle="Solid" BorderWidth="1px" Width="441px" Height="70px">
<br />
<asp:DropDownList ID="ddlEmpName" runat="server" Height="20px" OnSelectedIndexChanged="ddlEmpName_SelectedIndexChanged" Width="100px">
</asp:DropDownList>
<asp:DropDownList ID="ddlMonth" runat="server" Height="20px" OnSelectedIndexChanged="ddlMonth_SelectedIndexChanged" Width="93px">
</asp:DropDownList>
<asp:Button ID="btnShow" runat="server" OnClick="btnShow_Click" Text="Show" Width="87px" />
<asp:Button ID="btnExportToPDF" runat="server" OnClick="btnExportToPDF_Click" Text="ExportToPDF" />
</asp:Panel>
<br />
<br />
<asp:Panel ID="Panel1" runat="server" style="margin-left: 0px">
<asp:FormView ID="FormView1" runat="server" horizontalalign="Center" Width="859px" Visible="True">
<EditItemTemplate>
nvEmployeeName:
<asp:TextBox ID="nvEmployeeNameTextBox" CssClass="alg" runat="server" style="text-align:center" Text='<%# Bind("nvEmployeeName") %>' />
<br />
nvDesignation:
<asp:TextBox ID="nvDesignationTextBox" CssClass="alg" runat="server" Text='<%# Bind("nvDesignation") %>' />
<br />
nvTotalNoOfDays:
<asp:TextBox ID="nvTotalNoOfDaysTextBox" CssClass="alg" runat="server" Text='<%# Bind("nvTotalNoOfDays") %>' />
<br />
nvTotalNoOfDaysPresent:
<asp:TextBox ID="nvTotalNoOfDaysPresentTextBox" CssClass="alg" runat="server" Text='<%# Bind("nvTotalNoOfDaysPresent") %>' />
<br />
nvBasic:
<asp:TextBox ID="nvBasicTextBox" CssClass="alg" runat="server" Text='<%# Bind("nvBasic") %>' />
<br />
nvHRA:
<asp:TextBox ID="nvHRATextBox" CssClass="alg" runat="server" Text='<%# Bind("nvHRA") %>' />
<br />
nvTravelAllowances:
<asp:TextBox ID="nvTravelAllowancesTextBox" CssClass="alg" runat="server" Text='<%# Bind("nvTravelAllowances") %>' />
<br />
nvVA:
<asp:TextBox ID="nvVATextBox" CssClass="alg" runat="server" Text='<%# Bind("nvVA") %>' />
<br />
nvChildrenAllowances:
<asp:TextBox ID="nvChildrenAllowancesTextBox" CssClass="alg" runat="server" Text='<%# Bind("nvChildrenAllowances") %>' />
<br />
nvMedicalReimbursement:
<asp:TextBox ID="nvMedicalReimbursementTextBox" CssClass="alg" runat="server" Text='<%# Bind("nvMedicalReimbursement") %>' />
<br />
nvIncentive:
<asp:TextBox ID="nvIncentiveTextBox" CssClass="alg" runat="server" Text='<%# Bind("nvIncentive") %>' />
<br />
nvArrears:
<asp:TextBox ID="nvArrearsTextBox" CssClass="alg" runat="server" Text='<%# Bind("nvArrears") %>' />
<br />
nvLoan:
<asp:TextBox ID="nvLoanTextBox" CssClass="alg" runat="server" Text='<%# Bind("nvLoan") %>' />
<br />
nvAdvance:
<asp:TextBox ID="nvAdvanceTextBox" CssClass="alg" runat="server" Text='<%# Bind("nvAdvance") %>' />
<br />
nvTDS:
<asp:TextBox ID="nvTDSTextBox" CssClass="alg" runat="server" Text='<%# Bind("nvTDS") %>' />
<br />
nvPFEmployee:
<asp:TextBox ID="nvPFEmployeeTextBox" CssClass="alg" runat="server" Text='<%# Bind("nvPFEmployee") %>' />
<br />
nvMedicalReimbursementPayble:
<asp:TextBox ID="nvMedicalReimbursementPaybleTextBox" CssClass="alg" runat="server" Text='<%# Bind("nvMedicalReimbursementPayble") %>' />
<br />
nvOtherDeduction:
<asp:TextBox ID="nvOtherDeductionTextBox" CssClass="alg" runat="server" Text='<%# Bind("nvOtherDeduction") %>' />
<br />
nvSalaryInWords:
<asp:TextBox ID="nvSalaryInWordsTextBox" CssClass="alg" runat="server" Text='<%# Bind("nvSalaryInWords") %>' />
<br />
nvGrossSalary:
<asp:TextBox ID="nvGrossSalaryTextBox" CssClass="alg" runat="server" Text='<%# Bind("nvGrossSalary") %>' />
<br />
nvNetBankTransfer:
<asp:TextBox ID="nvNetBankTransferTextBox" CssClass="alg" runat="server" Text='<%# Bind("nvNetBankTransfer") %>' />
<br />
nvNetDeduction:
<asp:TextBox ID="nvNetDeductionTextBox" CssClass="alg" runat="server" Text='<%# Bind("nvNetDeduction") %>' />
<br />
<asp:LinkButton ID="UpdateButton" runat="server" CausesValidation="True" CommandName="Update" Text="Update" />
<asp:LinkButton ID="UpdateCancelButton" runat="server" CausesValidation="False" CommandName="Cancel" Text="Cancel" />
</EditItemTemplate>
<InsertItemTemplate>
nvEmployeeName:
<asp:TextBox ID="nvEmployeeNameTextBox" CssClass="alg" runat="server" Text='<%# Bind("nvEmployeeName") %>' />
<br />
nvDesignation:
<asp:TextBox ID="nvDesignationTextBox" CssClass="alg" runat="server" Text='<%# Bind("nvDesignation") %>' />
<br />
nvTotalNoOfDays:
<asp:TextBox ID="nvTotalNoOfDaysTextBox" CssClass="alg" runat="server" Text='<%# Bind("nvTotalNoOfDays") %>' />
<br />
nvTotalNoOfDaysPresent:
<asp:TextBox ID="nvTotalNoOfDaysPresentTextBox" CssClass="alg" runat="server" Text='<%# Bind("nvTotalNoOfDaysPresent") %>' />
<br />
nvBasic:
<asp:TextBox ID="nvBasicTextBox" CssClass="alg" runat="server" Text='<%# Bind("nvBasic") %>' />
<br />
nvHRA:
<asp:TextBox ID="nvHRATextBox" CssClass="alg" runat="server" Text='<%# Bind("nvHRA") %>' />
<br />
nvTravelAllowances:
<asp:TextBox ID="nvTravelAllowancesTextBox" CssClass="alg" runat="server" Text='<%# Bind("nvTravelAllowances") %>' />
<br />
nvVA:
<asp:TextBox ID="nvVATextBox" CssClass="alg" runat="server" Text='<%# Bind("nvVA") %>' />
<br />
nvChildrenAllowances:
<asp:TextBox ID="nvChildrenAllowancesTextBox" CssClass="alg" runat="server" Text='<%# Bind("nvChildrenAllowances") %>' />
<br />
nvMedicalReimbursement:
<asp:TextBox ID="nvMedicalReimbursementTextBox" CssClass="alg" runat="server" Text='<%# Bind("nvMedicalReimbursement") %>' />
<br />
nvIncentive:
<asp:TextBox ID="nvIncentiveTextBox" CssClass="alg" runat="server" Text='<%# Bind("nvIncentive") %>' />
<br />
nvArrears:
<asp:TextBox ID="nvArrearsTextBox" CssClass="alg" runat="server" Text='<%# Bind("nvArrears") %>' />
<br />
nvLoan:
<asp:TextBox ID="nvLoanTextBox" CssClass="alg" runat="server" Text='<%# Bind("nvLoan") %>' />
<br />
nvAdvance:
<asp:TextBox ID="nvAdvanceTextBox" CssClass="alg" runat="server" Text='<%# Bind("nvAdvance") %>' />
<br />
nvTDS:
<asp:TextBox ID="nvTDSTextBox" CssClass="alg" runat="server" Text='<%# Bind("nvTDS") %>' />
<br />
nvPFEmployee:
<asp:TextBox ID="nvPFEmployeeTextBox" CssClass="alg" runat="server" Text='<%# Bind("nvPFEmployee") %>' />
<br />
nvMedicalReimbursementPayble:
<asp:TextBox ID="nvMedicalReimbursementPaybleTextBox" CssClass="alg" runat="server" Text='<%# Bind("nvMedicalReimbursementPayble") %>' />
<br />
nvOtherDeduction:
<asp:TextBox ID="nvOtherDeductionTextBox" CssClass="alg" runat="server" Text='<%# Bind("nvOtherDeduction") %>' />
<br />
nvSalaryInWords:
<asp:TextBox ID="nvSalaryInWordsTextBox" CssClass="alg" runat="server" Text='<%# Bind("nvSalaryInWords") %>' />
<br />
nvGrossSalary:
<asp:TextBox ID="nvGrossSalaryTextBox" CssClass="alg" runat="server" Text='<%# Bind("nvGrossSalary") %>' />
<br />
nvNetBankTransfer:
<asp:TextBox ID="nvNetBankTransferTextBox" CssClass="alg" runat="server" Text='<%# Bind("nvNetBankTransfer") %>' />
<br />
nvNetDeduction:
<asp:TextBox ID="nvNetDeductionTextBox" CssClass="alg" runat="server" Text='<%# Bind("nvNetDeduction") %>' />
<br />
<asp:LinkButton ID="InsertButton" runat="server" CausesValidation="True" CommandName="Insert" Text="Insert" />
<asp:LinkButton ID="InsertCancelButton" runat="server" CausesValidation="False" CommandName="Cancel" Text="Cancel" />
</InsertItemTemplate>
<ItemTemplate>
<asp:image ID="Image1" runat="server"
ImageUrl="http://sals.breakthrough.org.in/images/breakthrough_logo.png" Height="60px" Width="90px" />
<br />
<br />
Breakthrough Trust<br />E-1A, First Floor, Kailash Colony, New Delhi-110048<br />SALARY SLIP:-
<br />
<br />
Employee Name:
<asp:Label ID="nvEmployeeNameLabel" runat="server" Text='<%# Bind("nvEmployeeName") %>' />
<br />
Employee Designation:
<asp:Label ID="nvDesignationLabel" runat="server" Text='<%# Bind("nvDesignation") %>' />
<br />
Total Days:
<asp:Label ID="nvTotalNoOfDaysLabel" runat="server" Text='<%# Bind("nvTotalNoOfDays") %>' />
<br />
Days Paid:
<asp:Label ID="nvTotalNoOfDaysPresentLabel" runat="server" Text='<%# Bind("nvTotalNoOfDaysPresent") %>' />
<br /><br />
EARNING
<br />
-----------------------------------------------------------------------------------------------------------------------<br />Description Amount
<br />
------------------------------------------------------------------------------------------------------------------------<br />Basic:
<asp:Label ID="nvBasicLabel" CssClass="alg" runat="server" Text='<%# Bind("nvBasic") %>' />
<br />
HRA:
<asp:Label ID="nvHRALabel" CssClass="alg" runat="server" Text='<%# Bind("nvHRA") %>' />
<br />
TravelAllowances:
<asp:Label ID="nvTravelAllowancesLabel" CssClass="alg" runat="server" Text='<%# Bind("nvTravelAllowances") %>' />
<br />
Variable Allowance:
<asp:Label ID="nvVALabel" CssClass="alg" runat="server" Text='<%# Bind("nvVA") %>' />
<br />
Medical Allowance:
<asp:Label ID="nvChildrenAllowancesLabel" CssClass="alg" runat="server" Text='<%# Bind("nvChildrenAllowances") %>' />
<br />
Children Educational Allowance:
<asp:Label ID="nvMedicalReimbursementLabel" CssClass="alg" runat="server" Text='<%# Bind("nvMedicalReimbursement") %>' />
<br />
Arrear:
<asp:Label ID="nvIncentiveLabel" CssClass="alg" runat="server" Text='<%# Bind("nvIncentive") %>' />
<br />
Incentive:
<asp:Label ID="nvArrearsLabel" CssClass="alg" runat="server" Text='<%# Bind("nvArrears") %>' />
<br /><br />
DEDUCTION
<br /> -----------------------------------------------------------------------------------------------------------------------<br />
Description
Amount
<br />-----------------------------------------------------------------------------------------------------------------------<br />
Loan:
<asp:Label ID="nvLoanLabel" CssClass="alg" runat="server" Text='<%# Bind("nvLoan") %>' />
<br />
Advance:
<asp:Label ID="nvAdvanceLabel" CssClass="alg" runat="server" Text='<%# Bind("nvAdvance") %>' />
<br />
PF:
<asp:Label ID="nvTDSLabel" CssClass="alg" runat="server" Text='<%# Bind("nvTDS") %>' />
<br />
TDS:
<asp:Label ID="nvPFEmployeeLabel" CssClass="alg" runat="server" Text='<%# Bind("nvPFEmployee") %>' />
<br />
Medical Allowance(P):
<asp:Label ID="nvMedicalReimbursementPaybleLabel" CssClass="alg" runat="server" Text='<%# Bind("nvMedicalReimbursementPayble") %>' />
<br />
Others:
<asp:Label ID="nvOtherDeductionLabel" CssClass="alg" runat="server" Text='<%# Bind("nvOtherDeduction") %>' />
<br />
<br />
------------------------------------------------------------------------------------------------------------------
<br />
Total Salary:
<asp:Label ID="nvSalaryInWordsLabel" CssClass="alg" runat="server" Text='<%# Bind("nvSalaryInWords") %>' />
<br />
Total Deduction:
<asp:Label ID="nvGrossSalaryLabel" CssClass="alg" runat="server" Text='<%# Bind("nvGrossSalary") %>' />
<br />
Net Payable:
<asp:Label ID="nvNetBankTransferLabel" CssClass="alg" runat="server" Text='<%# Bind("nvNetBankTransfer") %>' />
<br />
InWords:
<asp:Label ID="nvNetDeductionLabel" CssClass="alg" runat="server" Text='<%# Bind("nvNetDeduction") %>' />
<br />
</ItemTemplate>
</asp:FormView>
</asp:Panel>
</div>
</form>
</body>
</html>
Reply
Answers (
2
)
paging used in datagridview
how to translate english words to malayalam