|
code
newsgroups
|
|||||||||||||||||||||||
|
|||||||||||||||||||||||
GridView - ObjectDataSource - Dynamic Columnsexpressions ... provided the GridView and related Column TemplateFields are defined as inline HTML. I prefer to programmatically create the GridView Column/ TemplateField definitions at runtime.... because I do not know the number of applicable columns until runtime. The addition of the GridView Column/ TemplateFields work fine, however the "Eval" expressions do not result in data from the ObjectDataSource populating the GridView. I programmatically add the GridView Columns/ TemplateFields first and then I issue the DataBind method for the GridView. The "Eval" expressions are ignored. Any suggestions ? Thanks -- Philip Try to use DataBinder.Eval(). If it does not work, then you can do this
in XDataBindng(), where the X is the control (eg.TextBox) that has been bound. Dim gridRow as GridViewRow = Ctype(Ctype(tb.NamingContainer, GridViewRow) Dim drView as DataRowView = CType(gridRow.DataItem,(DataRowView)) X.Text = drView("YourFieldName") Hope this helps... Regards, Alvin Chooi Microsoft ASP.NET Enthusiast http://alvinzc.blogspot.com
Need button control that...
Can't duplicate ID in subclassed GridView 3 step wizard - ignore last step menu question Gridview sorting event - Gridview Datasource always Null .. why??? WebParts & Highend Portals way to make 2 GridViews line up Anyone have APP_LocalResources resx files for the MS controls... My own control - exception in Design view CustomValidator inside Repeater is ignored |
|||||||||||||||||||||||