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
narasiman rao
NA
519
766.9k
Adding value to datatable and bind to gridview
Sep 10 2015 2:29 AM
In run mode as follows
Major code AMC(Dropdownlist) Minor code AFF(dropdownlist) Button(Add)
BMC
Add button code as follows
protected void btnadd_Click(object sender, EventArgs e)
{
Dt.Columns.AddRange(new DataColumn[2] { new DataColumn("Major Code", typeof(string)),
new DataColumn("Minor Code", typeof(string))});
Dt.Rows.Add(ddlmjrcode.SelectedItem.ToString(), ddlminorcode.SelectedItem.ToString());
gvmajormaster.DataSource = Dt;
gvmajormaster.DataBind();
}
When i click the add button i want to add the AMC and AFF in first row in gridview and second row AMC and BMC for that how can i do in asp.net using c#.
Excepted output in Gridview as follows
Major code Minor code
AMC AFF
AMC BMC
But my output in gridview as follows
Major code Minor code
AMC AFF
When i add the second minor code in gridview in first row Minor code gets replaced.
for that how can i do in asp.net using c#.
Reply
Answers (
3
)
how to send json format values in windows form application
c #