I need a way to insert DataTable to asp GridView that contains already built Columns with turning autoGenerateColumns to False
I just need to connect some DataTable’s Columns to specific columns in Grid and
change other stay as they are
I need a way to insert DataTable to asp GridView that contains already built
Share
you can do that budy editing your data grid template
first you need to remove the autogenerated columns from edit columns .. then you add few templates as many as your columns from your datatable are
then you edit these templates and you’d notice that you have ItemTemplate, AlternateItemTemplate, EditItemTemplate, HeaderTemplate, FooterTemplate .. you can choose which template is that you want to edit and then add the sever control you want to show your data in into it .. when you add the server control you notice that you can bind a datacolumn to it by clicking Edit Databindings .. there you can choose which column from your datatable should be bound to this gridview column ..