using System;
using System.Data;
using System.Configuration;
using System.Collections;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Web.UI.HtmlControls;
using System.Data.SqlClient;
using System.Collections.Specialized;
using System.Text;
using System.Drawing;
using System.IO;
using System.Net;
using System.Net.Mail;
using System.Net.Configuration;
public partial class TESTFile : System.Web.UI.Page
{
protected void Page_Load(object sender, EventArgs e)
{
if (!IsPostBack)
{
DataTable dt = new DataTable();
dt.Columns.AddRange(new DataColumn[5] { new DataColumn("ID"), new DataColumn("Name"), new DataColumn("Qty"), new DataColumn("Rate"), new DataColumn("Name2") });
dt.Rows.Add(1, "AA", 10, 1, "AA");
dt.Rows.Add(2, "BB", 20, 2, "B");
dt.Rows.Add(3, "CC", 5, 5, "V");
dt.Rows.Add(4, "DD", 10, 5, "DD");
dt.Rows.Add(4, "EE", 10, 5, "EE");
dt.Rows.Add(4, "F", 10, 5, "FF");
GridView1.DataSource = dt;
GridView1.DataBind();
}
}
protected void GridView1_RowDataBound(object sender, GridViewRowEventArgs e)
{
}
}
.NET forums are moving to a new home on Microsoft Q&A, we encourage you to go to Microsoft Q&A for .NET for posting new questions and get involved today.
Member
294 Points
679 Posts
Check Column Data And Set Yes No In New Column
Oct 07, 2019 06:33 PM|Gopi.MCA|LINK
Hello
This is my code
code behind example
it showing result set like this
but i want like this
how to do automatically
Thanking You
Contributor
3370 Points
1409 Posts
Re: Check Column Data And Set Yes No In New Column
Oct 08, 2019 09:33 AM|samwu|LINK
Hi Gopi.MCA,
According to your description, i made demo for your.
I bulided a TemplateField in aspx firstly, then set the value of TemplateField by comparing the values of name and name2.
The code:
The result:
Best regards,
Sam