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
dhoni kholi
NA
198
43.2k
How to add one column in Gridview
Dec 28 2019 6:21 AM
How to Add dynamically One column in Gridview for Barcode
<
div
id
=
"gridContainer"
style
=
"overflow: scroll"
>
<
asp:GridView
ID
=
"GridView1"
runat
=
"server"
AutoGenerateColumns
=
"False"
CssClass
=
"myGrid"
AlternatingRowStyle-CssClass
=
"alt"
CellPadding
=
"3"
AllowPaging
=
"True"
BackColor
=
"White"
BorderColor
=
"#CCCCCC"
BorderStyle
=
"None"
BorderWidth
=
"1px"
DataSourceID
=
"dsProduct"
Width
=
"1019px"
Font-Names
=
"Arial"
onrowdatabound
=
"GridView1_RowDataBound"
>
<
AlternatingRowStyle
CssClass
=
"alt"
>
</
AlternatingRowStyle
>
<
Columns
>
<
asp:BoundField
DataField
=
"id"
HeaderText
=
"Id"
InsertVisible
=
"False"
ReadOnly
=
"True"
SortExpression
=
"id"
/>
<
asp:BoundField
DataField
=
"pname"
HeaderText
=
"Name"
SortExpression
=
"pname"
/>
<
asp:BoundField
DataField
=
"subhead"
HeaderText
=
"Code"
SortExpression
=
"subhead"
/>
<
asp:BoundField
DataField
=
"hsn"
HeaderText
=
"HSN"
SortExpression
=
"hsn"
/>
<
asp:BoundField
DataField
=
"qty"
HeaderText
=
"Quantity"
SortExpression
=
"qty"
/>
<
asp:BoundField
DataField
=
"cprice"
HeaderText
=
"Price"
SortExpression
=
"cprice"
/>
<
asp:BoundField
DataField
=
"tax"
HeaderText
=
"Tax %"
SortExpression
=
"tax"
/>
<
asp:HyperLinkField
HeaderText
=
"Action"
Text
=
"Edit / Delete"
/>
</
Columns
>
<
FooterStyle
BackColor
=
"White"
ForeColor
=
"Black"
/>
<
HeaderStyle
BackColor
=
"#006699"
Font-Bold
=
"True"
ForeColor
=
"White"
HorizontalAlign
=
"Center"
/>
<
PagerStyle
BackColor
=
"White"
ForeColor
=
"#000066"
HorizontalAlign
=
"Right"
/>
<
RowStyle
ForeColor
=
"#000066"
/>
<
SelectedRowStyle
BackColor
=
"#669999"
Font-Bold
=
"True"
ForeColor
=
"White"
/>
<
SortedAscendingCellStyle
BackColor
=
"#F1F1F1"
/>
<
SortedAscendingHeaderStyle
BackColor
=
"#007DBB"
/>
<
SortedDescendingCellStyle
BackColor
=
"#CAC9C9"
/>
<
SortedDescendingHeaderStyle
BackColor
=
"#00547E"
/>
</
asp:GridView
>
<
asp:SqlDataSource
ID
=
"dsProduct"
runat
=
"server"
ConnectionString
=
"<%$ ConnectionStrings:dbcon1 %>"
SelectCommand
=
"SELECT [id], [pname], [subhead], [qty], [cprice], [hsn], [tax] FROM [offset]"
>
</
asp:SqlDataSource
>
<
asp:Button
ID
=
"btnreport"
runat
=
"server"
Text
=
"Report"
CssClass
=
"btn-primary mar"
width
=
"105px"
/>
</
div
>
How to add new column Dynamically for
Bardcode in after Tax column ; Barcode Generated by code
Reply
Answers (
3
)
Section not defined In Index.cshtml in asp.net mvc?
How to save multiple rows into the database in mvc