.NET Tutorials, Forums, Interview Questions And Answers
Welcome :Guest
Sign In
Win Surprise Gifts!!!

Top 5 Contributors of the Month
Gaurav Pal
Post New Web Links

Bubbling events among field templates and filters

Posted By:      Posted Date: April 10, 2011    Points: 0   Category :ASP.Net

I'm writing this because I see the need of doing complex filtering based on a high level profile business view or executive management for generating statistical data and custom reports for making decisions

Having read about cascading and hierarchichal dependencies makes me wonder why hasn't been developed a more simpler solution like "Bubbling Event Among Field Templates". It would be just a matter of having an event passed via Dynamic Data architechture to a second and other dependant custom controls (field templates and filters). The way it is Dynamic Data right now doesn't allow you to do that

The main problem is that for doing so in the traditional way you must register the control and consume the event (mostly OnSelectedIndexChanged) and that is just not achievable in traditional Dynamic Data because teh controls are not really there but waiting to be used by the Dynamic Data engine framework

My question goes in the sense that this is an issue that should have been solved ages ago. There are plenty of solutions to this in CodePlex but not for Dynamic Data and I wonder why hasn't been done so?

The problem with cascading is that there is a lot of work that sould be done at database level and metadata files but why should you be restricted to do cascading that way only? There will be times were you might need to create and use your own que

View Complete Post

More Related Resource Links

Customizing Filters and Field Templates


I have customized a copy of ForeignKey_Edit.ascx and its .cs file and they are working fine to a certain extent. In the process of inserting records I show 3 DropDownLists which reside inside of the ForeignKey_Edit  control and I have managed to populate them accordingly but I can have only one label for the three of them as defined in the MetaData file. I have added custom legends to the left of the DropDownList but they look ugly because of the offset, they are shown aligned in the right column of the screen not where the other labels are displayed but that can be considered as well as cosmetic.

What is not so cosmetic is that only one of the three DropDownLists is displayed in the List page because I haven't been able to populate these fields in the non-edit version of the control FieldTemplates\ForeignKey.ascx with the same logic used before, non have I been able to populate the filter Filters\ForeignKey.ascx because the code used in its methods seems to be quite different from ones used in the fieldtemplate version of the control.



Problem with custom pages using ForeignKey.ascx & ForeignKey_Edit.ascx field templates


I have created a DynamicData website with a data model from Northwind (using Orders & Shippers tables Orders.ShipVia-> Shippers.ShipperId) I've turned scaffolding on.

I have then added a custom page by copying ListDetails.aspx from PageTemplate folder to the DynamicData\ CustomPages\Orders folder

Then I have edited the page:

And adding the following to the GridView1:


    <asp:DynamicField DataField="OrderID">
    <asp:DynamicField DataField="OrderDate">
    <asp:DynamicField DataField="ShippedDate">
    <asp:DynamicField DataField="ShipVia">

Dynamic Data Templates in GridView ASP.NET 3.5

At a high level, Dynamic Data Templates can be seen as a system to very quickly build up a User Interface linked with the relevant data model, immediately enabling you to perform CRUD operations (Create, Read, Update, Delete) on the database using the specified data source. They provide a powerful method for building up these kinds of applications, and I'm going to focus on an overview of what Dynamic Data Templates actually are, and a few ways of customizing them to suit industry needs.

WCF Tutorial - Events and Callbacks

we described how to make a very simple client/server application where clients would call functions on the server through a shared interface. In this tutorial, I'm going to expand that application to allow the server to execute functions on the client by using callbacks. Essentially, this is WCF's mechanism to allow events to be raised from the server to it's connected clients.

Delegates and events in c#.net

People often find it difficult to see the difference between events and delegates. C# doesn't help matters by allowing you to declare field-like events which are automatically backed by a delegate variable of the same name. This article aims to clarify the matter for you. Another source of confusion is the overloading of the term "delegate". Sometimes it is used to mean a delegate type, and at other times it can be used to mean an instance of a delegate type. I'll use "delegate type" and "delegate instance" to distinguish between them, and "delegate" when talking about the whole topic in a general sense.

jQuery 1.4 Opacity and IE Filters

client side jQuery library after switching to jQuery 1.4. I ran into a problem with a shadow plugin that I use to provide drop shadows for absolute elements - for Mozilla WebKit browsers the -moz-box-shadow and -webkit-box-shadow CSS attributes are used but for IE

calculation, field and map traverse adjustment, and coordinate transformation

Free Pocket PC land surveying software -- COGO calculation, field and map traverse adjustment, and coordinate transformation -- for students and professionals.

How to listen to events within a listview



I've got a listview and I've put a button control in one of the columns, I'm trying to figure out how I have listen to the button click within a certain row, but can't see the button in the dropdown for the IDs I can generate events for.

I'd like to get the primary key of the row that's been clicked on and then run a sql statement against it.

Any help would be appreciated.

Dropdown Event (Template Field)



I have grid view control that includes a dropdown control in a template field.

I wish to execute some code when the value is changed in the dropdown list.  Can't figure out how to capture this event though?

Any suggestions?

How to take value of bound field of grid in a variable or in a textbox.


How to take value of bound field of grid in a variable or in a textbox.

 I m using this code in .aspx page for grid.

<asp:GridView ID="Grd_Mprocess" runat="server" AutoGenerateColumns="False"

                      Width="100%" AllowPaging="True"


                      AllowSorting="True" PageSize="5"  >

                 <RowStyle CssClass="odd" />


<asp:BoundField HeaderText="DOC_TYPE_PK" DataField="DOC_TYPE_PK"  Visible="true" >


  <asp:TemplateField HeaderText="DOC TYPE ID" Visible="true">  &nbs

Missing 'new item templates'


 Hi all,

          I am a 'newbie' to VWD and I am slowly working through the Basic Walkthrough Help files, and learning plenty along the way.

However, when I tried to create a new database in the LINQ control walkthrough I found that the option to create a new database is missing, and further investigation has found that many other new item templates are missing.

I am using a brand new machine with Windows 7 Ultimate and have enabled IIS and .NET from Control Panel-Programs-Turn Windows Features On-Off. I used the WPI to install all basic elements eg. IIS Components, SQL Server Express.

The only 'new item templates' I have when I right-click the App_Data Folder and choose 'new item' are:-

ADO.NET Data Service

AJAX Enabled WCF Service

Dynamic Data Field

SQL Server Database

Text File

XML File

Does anyone know where I have gone wrong.


Michael J. Hill

Customizing the UI around the Filters


I have started working on a new project and thought it would be a great idea to dig into the latest version of the Dynamic Data framework that shipped with VS2010.  For the most part, I am impressed, it seems to be pretty easy to extend and create a rich and flexibile UI -- at least that is what I thought until I got to working on a better layout for the filters.

The situation is this:

I have a table with 25 columns and I need to display around 10 different filters (basically and interactive report) -- the filters are of various types.

The problem:

How in the world do I custom the UI layout of the filters.  It seems that with the latest QueryFilterRepeater control we have been left with almost nothing to work with (outside of turning filters on/off and setting the FilterUIHint).  What if I wanted to wrap all of the filters in an expand/collapse region and then inside of that have then sitting in a table of no more than 4 columns (so with 10 filters I wold have 3 rows). 

I have tried extending the QueryFilterRepeater but it seems like there is nothing in that class that we can work with (the data binding events are not even used).

Am I missing something, or am I just out of luck right now?

Customising filters in .NET 4


I have a .NET 3.5 Dynamic Data site that I am now overhauling to make it work under .NET 4.  I have managed most of it now (painfully!) but am struggling to get my old custom filters to work.

Under .NET 3.5, the default filter mark-up looked like this:

<asp:FilterRepeater ID="FilterRepeater" runat="server">
        <asp:Label runat="server" Text='<%# Eval("DisplayName") %>' AssociatedControlID="DynamicFilter$DropDownList1" />
        <asp:DynamicFilter runat="server" ID="DynamicFilter" OnSelectedIndexChanged="OnFilterSelectedIndexChanged" />
    <FooterTemplate><br /><br /></FooterTemplate>
This code shows all possible filters above the table; i.e., every column in the table containing a foreign key to another table.  I didn't want to see them all, just the one I was interested in, so previously I had this mark-up in my ListDetails.aspx file:

<asp:Label runat="server" Text="Panel" AssociatedControlID="DynamicFilterPanel$DropDownList1" style="padding-left: 20px;" />
<asp:DynamicFilter runat="server" ID="

I need help about nvarchar field



how can specified nvarchar data type without N''?

adding XML 'records' with a key field


I have a vb.net Sub that is successfully adding 'records' to my XML file:

Private Sub btnSubmit_Click(ByVal sender As System.Object, _
    ByVal e As System.EventArgs) Handles btnSubmit.Click             'for adding an XML 'record'
        Using ds As New DataSet()
            Dim dr As DataRow = ds.Tables(0).NewRow()
            dr("subject") = txtNewEvent.Text
            dr("year") = DateTime.Now.ToString("MM/dd/yy")
            txtNewEvent.Text = ""

Unable to get all the values from a field


Am reading an XML from web service and storing in  a dataset. 
then in write to a DataTable as follows

 DataTable dtResult1 = dsSearch.Tables["RESULTSET"];    
 DataTable dtHIT = dsSearch.Tables["HIT"];     
 DataTable dtField = dsSearch.Tables["FIELD"]; 

The issue  is  in the DataTable dtField i can only see 3 columns FieldID,Name,HIT_ID

The corresponding values in the dataTable looks like this for the corresponding fileds


I am unable to get the Field Name values 1,8799f4646b6ed9acde142581a84f75a6 ,234B5F5F-F247-4EB6-9E39-A7B64C7FE1BD,Yes...etc

What would be the cause for this...Any Help

Below is the structure of the XML-

- <HIT NO="1" RANK="2955" SITEID="0" MOREHITS="0" FCOCOUNT="0"> 
<FIELD NAME="rank">1</FIELD> 
<FIELD NAME="internalid">8799f4646b6ed9acde142581a84f75a6 </FIELD> 
<FIELD NAME="contentid">234B5F5F-F247-4EB6-9E39-A7B64C7FE1BD</FIELD> 
<FIELD NAME="contentids" /> 
<FIELD NAME="collection&

Individual field - MySQL



I was wondering how to recieve an individual field from my MySQL database.

I have been able to get a row, but what I am trying to do is get a name from my database and set it into the HeaderText in my DataGrid.

The way I am trying to do it at the moment is

using (OdbcCommand cmd = new OdbcCommand(formQuery, con))
                formDataGrid.Columns[0].HeaderText = cmd.ExecuteReader(
                    CommandBehavior.CloseConnection |

This doesn't seem to get a value from the GetValue, but if use

using (OdbcCommand cmd = new OdbcCommand(formQuery, con))
                formDataGrid.DataSource = cmd.ExecuteReader(
                    CommandBehavior.CloseConnection |

it will bind my data into the grid.

I just want to be able to change the HeaderText in the first coulmn of the DataGrid from one table and have the DataGrid be filled from another table.

I can fill the DataGrid its just changing the HeaderText that I am having trouble with.

Any help?

ASP.NetWindows Application  .NET Framework  C#  VB.Net  ADO.Net  
Sql Server  SharePoint  Silverlight  Others  All   

Hall of Fame    Twitter   Terms of Service    Privacy Policy    Contact Us    Archives   Tell A Friend