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
piyusha patravali
NA
40
0
Gridview Column Addition
Nov 15 2013 6:54 AM
Hi
I have grid as follows
Sr No
Min Value
Max Value
1
1
500
2
501
700
I have two text box 1.Min Value 2.Max Value
and one add button
Now i want that first i enter min value as 1 and max as 500
when next time i enter the values Min value should automatically displayed as 501 as shown above
(i.e last Max Value + 1)
how to do it im using following code to add values to grid
protected void BtnAdd_Click(object sender, EventArgs e)
{
DataTable obj = GetEmptyTable();
foreach (GridViewRow gvRow in this.gv.Rows)
{
obj.Rows.Add(
this.gv.DataKeys[gvRow.RowIndex].Values["MinValue"],
this.gv.DataKeys[gvRow.RowIndex].Values["MaxValue"],
gvRow.Cells[1].Text,
gvRow.Cells[2].Text);
}
obj.Rows.Add(
this.TextBox1.Text,
this.TextBox2.Text,
)
;
this.gv.DataSource = obj;
this.gv.DataBind();
}
and getemptyTable is
private static DataTable GetEmptyTable()
{
var obj = new DataTable();
obj.Columns.Add("MinValue");
obj.Columns.Add("MaxValue");
return obj;
}
Please Help
Reply
Answers (
4
)
Find standard deviation and variance of a column
How to send push notifications from C# to apple phone.....?