Click here to Skip to main content
15,888,610 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
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.

XML
<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.
Posted

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900