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 the CTS

1 Answers  


Hello guyz, I have interview scheduled next week on .Net Framework 1.1? Can any one please provide a) list of interview questions on .net frame work 1.1? b)basic differences between .net framework 1.1 and 2.0 and 3.5 c)the topics that i need to concentrate while preparing Thanks in advance

0 Answers   Logica CMG, TCS,


How big is the char ?

1 Answers  


What are action filters?

0 Answers  


What are multicast delegates ? give me an example

1 Answers  


Explain tempdata in asp.net mvc?

0 Answers  


What is connected scenario? : Entity framework

0 Answers  


Can you write a class without specifying namespace? Which namespace does it belong to by default?

1 Answers  


Why do you need to box a primitive variable

1 Answers  


Name a few different return types of a controller action method?

0 Answers  


Can I use razor code in javascript in asp.net mvc?

0 Answers  


explain what does .edmx file contains?

0 Answers   Microsoft,


Categories