|
Hi:
How can i display fields from two or more tables to one grid?
Please let me know.
Regards,
eshwar_gp
|
|
|
Use a template column in your datagrid. Call a function within that template. That function then queries the second table in your database and generates appropriate output. Like so:
<asp:TemplateColumn HeaderText="Information">
<ItemTemplate>
<%# GridOutput(Container.DataItem("Idx")) %>
</ItemTemplate>
</asp:TemplateColumn>
Function GridOutput(Idx as integer)
'some code to query table
'some html string built as needed
'return the string
end function
In the case above, the custom function is GridOutput. Write this function and query data as much as you want. Special important note: You will need to open a second connection, as the first is busy filling the datagrid.
Good luck.
|
|
|
|
|
|
|
// |