How to bind table coloum with gridview column
Answers were Sorted based on User's Feedback
Answer / eyesice
DataTable dt = new DataTable("Sample");
DataColumn dc;
dc = new DataColumn("ID");
dc.DataType = System.Type.GetType("System.Int32");
dt.Columns.Add(dc);
dc = new DataColumn("Name");
dc.DataType = System.Type.GetType("System.String");
dt.Columns.Add(dc);
dataGridView1.DataSource = dt;
| Is This Answer Correct ? | 4 Yes | 0 No |
Answer / srinu.dotnetspider
hi friends, How to bind table coloum with gridview column>
i have 1 table and gridview, in that table eventype is one
of the column .
eventype
---------
2
4
5
6
now my requirement is eventype =1 then change gridview column
and also some msg like programer is logged in..etc
| Is This Answer Correct ? | 2 Yes | 4 No |
Answer / amit
hi,
you use gridview content click event, in this you do like that
if (dgvCustomers.CurrentRow.Index != -1)
{
if (dgvCustomers.CurrentCell.OwningColumn.Name == "eventype")
if (Convert.ToString(dgvCustomers.CurrentCell.Value) ==
"1")
{ msgbox.show("Hello World ..."); }
}
else
{
MessageBox.Show("Hi its amit" );
}
| Is This Answer Correct ? | 3 Yes | 7 No |
Explain tempdata in asp.net mvc?
Which is the best institute in hyderabad to learn DotNet?
152 Answers Cygnet Infotech, Infosys, Student, SVIT, TCS,
Which are the important namespaces used in ASP.Net MVC?
How to return the JSON from action method in ASP.Net MVC?
About DTS package ?
1 Answers Accenture, Grafotech,
About Assembly in .NET, types of assemblies, their difference, How to register into GAC. How to generate the strong names & its use ?
6 Answers Infosys, Microsoft, MMTS,
What are the versions of .net framework?
What is the use of dataadapter ?
mention what is the key advantage of using entity framework or ef?
How we can call a JavaScript function on the change of a Dropdown List in ASP.Net MVC?
Which is the root namespace for fundamental types in .net framework?
what is the additional features in 1.1 rather than 1.0