Ask a Question related to ASP.NET Data Grid Control, Design and Development.
-
JcFx #1
Complex data binding question, binding child objects of a custom collection.
I have a custom collection of objects, each of which includes a child
object called MyUserOpener. In declarative binding, I can bind this
property to a label in a template control with the following syntax:
<%# DataBinder.Eval(CType(Container.DataItem.MyUserOpe ner,
AAA_Business.AAA_User), ("AAA_User__UserName"))%>
So far so good, this works fine.
I'm now trying to generate this datagrid dynamically incode. I'm using
reflection to inspect the properties of an object and generating a
column for each property, then binding the custom collection to the
grid, so my code looks something like this:
For Each ObjProperty As PropertyInfo In ObjProperties
Dim PropName As String = ObjProperty.Name.ToString()
Dim DataColumn As New BoundColumn
DataColumn.HeaderText = PropName.Substring(TableName.Length +
2).Replace("_", " ")
DataColumn.DataField = PropName
Me.m_grid.Columns.Add(DataColumn)
End If
Next
This works perfectly to generate bound columns for the simple
properties of my object, but I'm stumped trying to generate a column
for the complex binding to the child property. I understand how to
generate the template column but I can't figure out how to translate
the DataBinder.eval databinding statement to replicate the complex
binging in code behind.
Can anyone help ?
Many thanks in advance for any replies.
JcFx Guest
-
Binding to a complex data model
I am trying to one-way bind a custom component to a complex actionscript data model (the complex data model actually represents a c# dataset). ... -
Complex XML help with Data Binding
Ok. I load an external XML file from a remote server to my movie. I use a dummy XML to define the structure for the XML connector. I checked the... -
binding DataGrids to a Custom Collection
Hi, Has anyone read Jan Tielens article on Data binding and Web Services using Custom Collections? ... -
URGENT question about binding collection to a datagrid onitemdatabound
The following code works to hide specific columns before they are bound to a datagrid that has "autogeneratecolumns=true" enabled. My question is:... -
Binding custom objects to datagrid WITHOUT using Collectionbase
Hi I'm having difficulty bind a collection of custom objects to a datagrid. For reasons that I'll explain shortly I can't use Collectionbase, so...



Reply With Quote

