A recurring task in software development is representing tabular data in master detail format. ASP.Net provides a number of tools for performing this task. Here I will show how to use nested grid view to show detail data related to master table on asp.net web page.
Technique
Take a grid view that display data from master table. Create last column of this grid as TemplateField. Inside this TemplateField, take another girdview to display data from detail table. Bind detail grid view in OnRowDataBound event of master grid view with related data of respective row.
Defining Task
We will bind departments of a company in a CheckedList box. We want to display employee information of selected departments to gridview. Master grid will bind department names and Detail grid will display employee information of respective department.
Notice in above HTML code I have taken gvDeptNameList to display department list. Here I have taken two columns. First one to display department name and second on to display related employee information of the department. Second column is TempalteField and contain Detail grid.
Here notice that I find gridview gvEmpLstByDeptAndEmpType inside row of gvDeptNameList that is binding its row data. Then bind related employee information to gvEmpLstByDeptAndEmpType.
Conclusion
Here I have illustrated how you can extend the functionality of GridView control to display related data by using nested GridView controls on an ASP.NET Web page. You can also extend your application to enable data to be updated and deleted or enable users to insert new records.
You can easily use flash movie file in our asp.net web application.For this purpose I am using FlashControl.dll which is downloadable from here. Download free version. It works fine.
First, you have to add this control to visual studio 2008 toolbox. To do this, put FlashControl.dll file to folder of your choice. I am kept it to C:\Program Files\Microsoft ASP.NET\. Now in Visual Studio, open the Toolbox window, right-click on a tab. Select “Add Tab” option. Name it “Flash” and click ok to add new tab named “Flash”. Now right-click on “Flash” tab and select "Choose items..." option. Choose Toolbox Items dialog box opens. On the ".Net Framework components" tab click "Browse..." and select the "FlashControl.dll" file from the location you kept it. I this case it is C:\Program Files\Microsoft ASP.NET\. Check that flash control is added in the list and is selected. Click OK button to add it to toolbox.
Now take a new website project. Open your default.aspx file. Now drag and drop it on your page and set MovieUrl properties to your .swf file path. In this case MovieUrl= "~/Movie/8311.swf". Optionally you can set height and width. Note that in your source page added two tags:
You can change any FlashControl’s properties (Height, Width, Menu, Loop, Scale ...) in the designer view, by using the Smart Tag or in the Properties Window.
Now run your application to enjoy flash movie on you ASP.Net web applicat