Grid view showing null columns
-
I have a data gridview on which I want to display data from a datatable. For some unknown reasons, the datatable returns the expected columns plus other unexpected columns with no values in them.I've checked all of my stored procedures and methods that return the datatable and they seem to be fine. How do I limit the gridview to columns I need to see and restrict the other useless columns from displaying in my grid view? Forgive me if I'm in a wrong forum.
ML Lingwati
-
I have a data gridview on which I want to display data from a datatable. For some unknown reasons, the datatable returns the expected columns plus other unexpected columns with no values in them.I've checked all of my stored procedures and methods that return the datatable and they seem to be fine. How do I limit the gridview to columns I need to see and restrict the other useless columns from displaying in my grid view? Forgive me if I'm in a wrong forum.
ML Lingwati
If you are using
GridView
control then use DataBoundFileds,if you are usingdataGridView
then you should post question in C# forum.
I Love T-SQL "Don't torture yourself,let the life to do it for you." If my post helps you kindly save my time by voting my post. www.aktualiteti.com
-
I have a data gridview on which I want to display data from a datatable. For some unknown reasons, the datatable returns the expected columns plus other unexpected columns with no values in them.I've checked all of my stored procedures and methods that return the datatable and they seem to be fine. How do I limit the gridview to columns I need to see and restrict the other useless columns from displaying in my grid view? Forgive me if I'm in a wrong forum.
ML Lingwati
LucBite wrote:
For some unknown reasons, the datatable returns the expected columns plus other unexpected columns with no values in them.
I guess this is the problem with your SP/ Query that you have written :)
LucBite wrote:
How do I limit the gridview to columns I need to see and restrict the other useless columns from displaying in my grid view?
You have to check it during
RowDataBound
Event :)Abhijit Jana | Codeproject MVP Web Site : abhijitjana.net Don't forget to click "Good Answer" on the post(s) that helped you. View My Latest Article
-
I have a data gridview on which I want to display data from a datatable. For some unknown reasons, the datatable returns the expected columns plus other unexpected columns with no values in them.I've checked all of my stored procedures and methods that return the datatable and they seem to be fine. How do I limit the gridview to columns I need to see and restrict the other useless columns from displaying in my grid view? Forgive me if I'm in a wrong forum.
ML Lingwati
Which are these columns.... Means r u getting same columns twice?? Just see that u haven't added columns at design time and also binding gridview at runtime.
By: Hemant Thaker
-
Which are these columns.... Means r u getting same columns twice?? Just see that u haven't added columns at design time and also binding gridview at runtime.
By: Hemant Thaker