The goal is to fill the 3 columns in gridview1 with the data from the bll and have the last field a textbox that is editable by users. Please help me if you can. I have tried with just this code and I get the following error:
"A field or property with the name 'PerformerName' was not found on the selected data source."
Ok, So I had a field spelled incorrectly and this does work after I corrected it.. On top of that if fixed my 2 other gridview questions... Thank God!!
Marked as answer by Schwimms on Aug 01, 2012 10:56 PM
Schwimms
Member
100 Points
327 Posts
Bind Gridview Boundfields From BLL
Aug 01, 2012 10:44 PM|LINK
Hi All,
Adding to the pain.... I am looking to add 3 columns that are retrieved from my BLL to a gridview that has 4 columns.
So this is how I call my BLL and it returns 3 columns:
Dim PerformerFT As New PerformerByFTBLL() GridView1.DataSource = PerformerFT.GetPerformerByFT(NameTextBox.Text) GridView1.DataBind()The three columns returned from the bll are id, name, description. Now gridview1 has 4 columns in it.
<asp:GridView ID="GridView1" runat="server" AutoGenerateSelectButton="True"> <Columns> <asp:BoundField DataField="ID" HeaderText="ID" ReadOnly="True" SortExpression="ID" /> <asp:BoundField DataField="Name" HeaderText="Name" ReadOnly="True" SortExpression="Name" /> <asp:BoundField DataField="Description" HeaderText="Description" ReadOnly="True" SortExpression="Description" /> <asp:TemplateField AccessibleHeaderText="Time" HeaderText="Time"> <ItemTemplate> <asp:TextBox ID="TimeTextBox" runat="server"></asp:TextBox> </ItemTemplate> </asp:TemplateField> </Columns> </asp:GridView>The goal is to fill the 3 columns in gridview1 with the data from the bll and have the last field a textbox that is editable by users. Please help me if you can. I have tried with just this code and I get the following error:
"A field or property with the name 'PerformerName' was not found on the selected data source."
Schwimms
Member
100 Points
327 Posts
Re: Bind Gridview Boundfields From BLL
Aug 01, 2012 10:55 PM|LINK
Ok, So I had a field spelled incorrectly and this does work after I corrected it.. On top of that if fixed my 2 other gridview questions... Thank God!!