Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <asp:TemplateField HeaderText="Include In Food Bag" ItemStyle-Width="20%" ItemStyle-HorizontalAlign="Center" FooterStyle-HorizontalAlign="Center">
- <ItemTemplate>
- <asp:CheckBox runat="server" ID="ChkBxIncludeInFoodBag" Checked='<%# Bind("IncludeInFoodBag") %>' ></asp:CheckBox>
- </ItemTemplate>
- <FooterTemplate>
- <asp:CheckBox runat="server" ID="ChkBxIncludeInFoodBag"></asp:CheckBox>
- </FooterTemplate>
- </asp:TemplateField>
- protected void BindFoodBagItemsGridView()
- {
- DataTable FoodBagItems = BLFoodBagItem.GetAllFoodBagItems();
- if (FoodBagItems.Rows.Count > 0)
- {
- FoodBagItemsGridView.DataSource = BLFoodBagItem.GetAllFoodBagItems();
- }
- else
- {
- tempFoodItems = new DataTable();
- tempFoodItems.Columns.Add("FoodBagItemId");
- tempFoodItems.Columns.Add("ItemName");
- tempFoodItems.Columns.Add("ItemQuantity");
- tempFoodItems.Columns.Add("IncludeInFoodBag");
- DataRow dr = tempFoodItems.NewRow();
- dr["IncludeInFoodBag"] = bool.Parse("false");
- -- I also tried dr["IncludeInFoodBag"] = false;
- -- I also tried dr["IncludeInFoodBag"] = 0;
- tempFoodItems.Rows.Add(dr);
- FoodBagItemsGridView.DataSource = tempFoodItems;
- }
- FoodBagItemsGridView.DataBind();
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement