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
Guest User
Tech Writer
26
4k
Add row from textbox to listview
Sep 11 2018 9:34 PM
What should i do? It doesnt add a row even if i already declare a new row.
//This is my behind codes in add button
DataTable dt = new DataTable();
DataRow dr = null;
dt.Columns.Add(new DataColumn("Column1", typeof(string)));
dt.Columns.Add(new DataColumn("Column2", typeof(string)));
dr = dt.NewRow();
dr["Column1"] = "";
dr["Column2"] = TextBox1.Text;
dt.Rows.Add(dr);
ViewState["CurrentTable"] = dt;
ListView1.DataSource = dt;
ListView1.DataBind();
//This is my layout code
<asp:ListView ID="ListView1" runat="server">
<LayoutTemplate>
<div >
<table id="Table1" runat="server">
<tr id="Tr1" runat="server">
<td id="Td2" runat="server">
<table id="itemPlaceholderContainer" runat="server" border="0">
<tr id="Tr2" runat="server">
<th id="Th1" runat="server">ID</th>
<th id="Th2" runat="server">AppName</th>
</tr>
<tr runat="server" id="itemPlaceholder">
</tr>
</table>
</td>
</tr>
</table>
</div>
</LayoutTemplate>
<ItemTemplate>
<div>
<td id="Td1" runat="server"> <%#Eval("Column1") %>
</td>
<td id="Td2" runat="server"> <%#Eval("Column2") %>
</td>
</div>
</ItemTemplate>
</asp:ListView>
Reply
Answers (
2
)
Invalid object name 'dbo.TransactionsTyps'.
excel worksheet into another work sheet