Hi! Good morning, afternoon, evening, early morning. Thank you reading these lines I appreciate it. I am looking for new ideas.
I have a datagrid (not datagridview) which shows data from one view and a couple of tables where I have a repeater inside.
<asp:TemplateColumn HeaderText="All Details" Visible="false" ItemStyle-Width="400">
<ItemTemplate>
<%--<%# DataBinder.Eval(Container.DataItem, "IdPerson")%>--%>
<asp:Repeater ID="rptDetails" runat="server" DataSource='<%# DirectCast(Container.DataItem, DataRowView).CreateChildView("tblRelationship") %>'>
<ItemTemplate>
<%# DataBinder.Eval(Container.DataItem, "AllNotes")%>
<br />
</ItemTemplate>
</asp:Repeater>
</ItemTemplate>
<HeaderStyle Width="150px" />
<ItemStyle Width="400px" />
</asp:TemplateColumn>
The mission is: create a filter where you can select a "Detail" and Datagrid will show you the filtered data.
I am not able to use a big query because from that View I have 0-1 or more "Details". Both are different queries.
I tried:
Creating a function in order to show and hide rows -> It never detected that DirectCast(Container.DataItem, DataRowView).CreateChildView("tblRelationship")
Comparing on dataitembound with the "cell(index)" It didn't get the values.
Any idea?
Thank you for reading.