471,595 Members | 1,740 Online
Bytes | Software Development & Data Engineering Community
Post +

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 471,595 software developers and data experts.

GridView - ObjectDataSource - Data Binding

I can use a GridView and ObjectDataSource to bind my data using "Eval"
expressions ... 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
Oct 24 '06 #1
2 8634
Philip,

Try calling the DataBind method explicitly after adding the columns.

--
Eliyahu Goldin,
Software Developer & Consultant
Microsoft MVP [ASP.NET]
"Philip" <ph****@softwareforever.comwrote in message
news:22**********************************@microsof t.com...
>I can use a GridView and ObjectDataSource to bind my data using "Eval"
expressions ... 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

Oct 24 '06 #2
I am already issuing the DataBind explicitly after I add the Columns.
--
Philip
"Eliyahu Goldin" wrote:
Philip,

Try calling the DataBind method explicitly after adding the columns.

--
Eliyahu Goldin,
Software Developer & Consultant
Microsoft MVP [ASP.NET]
"Philip" <ph****@softwareforever.comwrote in message
news:22**********************************@microsof t.com...
I can use a GridView and ObjectDataSource to bind my data using "Eval"
expressions ... 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


Oct 24 '06 #3

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

1 post views Thread by Markus Palme | last post: by
3 posts views Thread by mateo | last post: by
5 posts views Thread by GaryDean | last post: by
2 posts views Thread by Greg | last post: by
4 posts views Thread by Tomasz Jastrzebski | last post: by
5 posts views Thread by Randy Smith | last post: by
4 posts views Thread by GaryDean | last post: by
3 posts views Thread by Peter | last post: by
reply views Thread by XIAOLAOHU | last post: by
reply views Thread by leo001 | last post: by

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.