i have table student with 5 columns that is student_id,student_name,student_class,student_gender,student_position, i only want show 3 columns that is student_name,student_class ,student_position i use this query
select student_name,student_class ,student_position from student,the issue is whenever i come to load my gridview i got the rest two columns what will i do to hide the
have tried this but not working
gdvstudent.Columns[1].Visible=false;
but not working ,anybody with idea help please using asp.net c#
Bhuvanesh MohankumarPosted May 12, 2016, 9:09 AM
You should make the "Auto Generate Column" option in grid to false, so what ever you specify only those columns will be displayed in grid view.
Bhuvanesh MohankumarPosted May 13, 2016, 4:04 AM
Yes, you can use.
Carlos kambuiPosted May 13, 2016, 3:05 AM
Bhuvanesh MohankumarPosted May 12, 2016, 12:36 PM
Carlos kambuiPosted May 12, 2016, 10:01 AM
Carlos kambuiPosted May 12, 2016, 10:00 AM
Bhuvanesh MohankumarPosted May 12, 2016, 9:52 AM
Hi Carlos,
You are binding the data to the grid using databind in code behind .aspx.cs file,
Carlos kambuiPosted May 12, 2016, 9:46 AM