Vikas Ahlawat

Vikas Ahlawat

  • NA
  • 564
  • 808.9k

Gridview inside gridview Problem.

Apr 18 2011 7:07 AM
I want to take gridview inside gridview.
Parent gridview for company detail and child gridview for its executive detail.
Main this is that in both gridview columns are dynamic, means use can choose that which column its want by checkboxes which are on the previous page.
Here i am not using Eval function because columns are dynamicaly decide on run time.

  <asp:GridView ID="GridView1" runat="server" Width="100%">
  <Columns>
  <asp:TemplateField>
  <ItemTemplate>
  <table>
  <tr>
  <td>
 
<asp:GridView ID="gvKeyExecutive" runat="server" DataSource='<%#  ReturnExecutiveDatatable(Convert.ToInt32(Eval("GDP_ID"))) %>'>
  </asp:GridView>

  </td>
  </tr>
  </table>
 
  </ItemTemplate>
  </asp:TemplateField>
  </Columns>
  </asp:GridView>



In the below image there are two Gridview first gridridview have dynamic columns and second gridview have fix columns. But these is no problem in second gridview designing , because in this do to fix columns i can use eval function and put it inside table etc.
but in the first i m not using Eval do to Dynamic columns The above code is for first gridview. I want to display it like second gridview. is there a way to use eval dynamicaly or suggest me other  way to solve this designing problem.




Answers (5)