Learn how to use and navigate the new features included in Bootstrap 4, the most popular HTML, CSS, and JavaScript framework for developing responsive, mobile-first websites.
Do more with
<asp:GridView ID="GridView1" runat="server" Width="100%" AllowPaging="True"
AutoGenerateColumns="False" Font-Names="Arial" Font-Size="Small"
Height="38px" HorizontalAlign="Center" OnPageIndexChanging="GridView1_PageIndexChanging"
PagerSettings-Mode="NextPrevious" PagerSettings-NextPageText="Next"
PagerSettings-PreviousPageText="Back">
<PagerSettings NextPageText="Next" PreviousPageText="Back" />
<Columns>
<asp:TemplateField>
<ItemTemplate>
<asp:ImageButton ID="ibtngrid0" runat="server" CommandArgument='<%# DataBinder.Eval(Container.DataItem, "Photo") %>'
Height="50" ImageUrl='<%# DataBinder.Eval(Container.DataItem, "Photo") %>' OnCommand="ImageButton1_Command"
Width="70" />
</ItemTemplate>
<ItemStyle HorizontalAlign="Center" Width="100px" />
</asp:TemplateField>
<asp:TemplateField>
<ItemTemplate>
<table cellpadding="0" cellspacing="0" border="0" width="100%">
<tr>
<td>
<asp:Label ID="lblTitle" Text='<%# DataBinder.Eval(Container.DataItem, "Title") %>' Font-Bold="True" runat="Server" ></asp:Label>
</td>
</tr>
<tr>
<td>
<asp:Label ID="lblDescr" Text='<%# DataBinder.Eval(Container.DataItem, "Descr") %>' runat="Server" />
</td>
</tr>
</table>
</ItemTemplate>
</asp:TemplateField>
</Columns>
<HeaderStyle HorizontalAlign="Center" />
</asp:GridView>
protected void GridView1_RowDataBound(object sender, GridViewRowEventArgs e)
{
if (e.Row.RowType == DataControlRowType.DataRow)
{
DataList lst = e.Row.FindControl("DataList1") as DataList;
lst.DataSource = "your data source for list";
lst.DataBind();
}
}
protected void GridView1_RowDataBound(object sender, GridViewRowEventArgs e)
{
if (e.Row.RowType == DataControlRowType.DataRow)
{
List<DataRowView> lstDataList = new List<DataRowView>();
lstDataList.Add(((DataRowView)e.Row.DataItem));
DataList lst = e.Row.FindControl("DataList1") as DataList;
lst.DataSource = lstDataList;
lst.DataBind();
}
}
Premium Content
You need an Expert Office subscription to comment.Start Free Trial