How to bind table coloum with gridview column

Answers were Sorted based on User's Feedback



How to bind table coloum with gridview column..

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

How to bind table coloum with gridview column..

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

How to bind table coloum with gridview column..

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

Post New Answer

More Dot Net Framework Interview Questions

what is a round trip?What is a postback?

4 Answers   Bosch, ONOTech,


What is a model in android?

0 Answers  


Tell me the best web-sites for Learning the ASP DOT NET.

3 Answers  


What is .net architecture?

0 Answers  


how to face first interview in .NET?

2 Answers   HCL, Xponent,






creating crystal reports in asp.net & vb.net

1 Answers  


mention what is the key advantage of using entity framework or ef?

0 Answers   Microsoft,


List the new features added in .net framework 4.0.

0 Answers  


I want to fetch data from datareader. i have three tables in datareader. i want to bind my two table with datagrid, then i want to fetch a value from my third table. do u have any idea pls help me. we use dr.nextresult() for multiple tables.

0 Answers  


Can I remove .net framework?

0 Answers  


What are the main components of .net framework?

0 Answers  


What is GUID and why we need to use it and in what condition? How this is created

1 Answers  


Categories