473,395 Members | 1,730 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,395 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 8724
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 thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
by: Markus Palme | last post by:
Hi NG! I've created a typed dataset by dropping a table from the server explorer to the dataset designer. I bound this DataSet to a GriedView using a ObjectDataSource. The data is being...
3
by: mateo | last post by:
Hello, I have a GridView inside which i want to show 3 dropdownList (one for each Column). So i've created 3 TemplateField Continent Country City
2
by: Ian | last post by:
Hiya, Hope this isn't too stupid a question :) I can bind an objectdatasource to a gridview very easily (and there's a thousand tutorials of this on the net). BUT! I just want to get at...
5
by: GaryDean | last post by:
I have a GridView that works fine when I bind it to an ObjectDataSource at design time. But if I bind it at run time nothing happens. On a button click event I say... GridView1.DataSourceID =...
2
by: Greg | last post by:
Hello, I am trying to bind a GridView to a custom object I have created. First, here is what I'm trying to do: I have a wizard for adding/editing Users. When the wizard begins, a User...
4
by: Tomasz Jastrzebski | last post by:
Hello Everyone, I have a GridView control bound to a plain DataTable object. AutoGenerateEditButton is set to true, Edit button gets displayed, and RowEditing event fires as expected.
5
by: Randy Smith | last post by:
Hi ALL, I wonder if anyone has been using n-tier to bind to a GridView control by using the ObjectDataSource. This is our first OOP web application, and we have no tables. Right now we are...
4
by: GaryDean | last post by:
I have an objectdatasource reading a dataset and I have a gridview using that objectdatasource (at design time). It binds fine but I need to clear it. myGridView.DataSource = null:...
3
by: Peter | last post by:
I have a GridView which is populated by List<ofObjects> Does anyone have example of how to sort the columns of this GridView? I have found examples without DataSourceControl but these use...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...

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.