Markup
<asp:GridView ID="GridView1" runat="server" AutoGenerateColumns="False">
<Columns>
<asp:BoundField DataField="insured_first_name" HeaderText="First Name" />
<asp:BoundField DataField="insured_first_name" HeaderText="Middle Name" />
<asp:BoundField DataField="insured_last_name" HeaderText="Last Name" />
</Columns>
</asp:GridView>
Code
GridView1.DataSource = _dataSet
DataBind()
Whenever my GridView populates, if there is no value to return from my _dataSet for a field, my GridView stops populating after that. Shouldn’t it skip that and continue populating the rest of the grid? It seems the GridView won’t accept an empty/null value. Any work-around for this?
The null is causing a dataerror event to be triggered which your gridview is not recovering from.
You should sterilize null values prior to adding them as a datasource for your gridview.
Check out:
http://msdn.microsoft.com/en-us/library/ms366709.aspx
for more information.