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
scropio gurl
NA
147
99.5k
display gridview on button click
Sep 7 2016 5:49 AM
First i try to displaly gridview on pageload so girdveiw succesffully displayed now i try to display when click on button i try below code but grid not visible
Code
DataTable dt =
new
DataTable();
public
DataTable info(string id)
try
{
Entities2 wr =
new
Entities2();
List<spv_Result> sv = wr.spvec(id).ToList();
dt.Columns.Add(
"RowNumber"
, typeof(
int
));
foreach (var c in sv)
{
dt.Rows.Add(c.RowNumber);
}
return
dt;
}
catch
(Exception ex)
{
throw
new
Exception();
}
}
protected
void
Button1_Click(object sender, EventArgs e)
{
info(id);
GridView1.DataSource = dt;
GridView1.DataBind();
}
there is data in dt but gridview not display
<
asp:GridView
ID
=
"GridView1"
runat
=
"server"
class
=
"display nowrap"
Width
=
"100%"
CellPadding
=
"0"
Font-Names
=
"Verdana"
BackColor
=
"White"
BorderColor
=
"#CCCCCC"
BorderStyle
=
"None"
BorderWidth
=
"1px"
Font-Size
=
"9pt"
>
<
FooterStyle
BackColor
=
"White"
ForeColor
=
"#000066"
/>
<
HeaderStyle
BackColor
=
"#006699"
Font-Bold
=
"True"
ForeColor
=
"White"
/>
<
PagerStyle
BackColor
=
"White"
ForeColor
=
"#000066"
Horizontal
/>
<
RowStyle
ForeColor
=
"#000066"
/>
<
SelectedRowStyle
BackColor
=
"#669999"
Font-Bold
=
"True"
ForeColor
=
"White"
/>
<
SortedAscendingCellStyle
BackColor
=
"#F1F1F1"
/>
<
SortedAscendingHeaderStyle
BackColor
=
"#007DBB"
/>
<
SortedDescendingCellStyle
BackColor
=
"#CAC9C9"
/>
<
SortedDescendingHeaderStyle
BackColor
=
"#00547E"
/>
any solution?
Reply
Answers (
6
)
How to convert html to pdf
Its cant print singly...