473,372 Members | 1,529 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,372 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 8723
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
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...
0
by: ryjfgjl | last post by:
In our work, we often need to import Excel data into databases (such as MySQL, SQL Server, Oracle) for data analysis and processing. Usually, we use database tools like Navicat or the Excel import...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
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
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
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...

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.