Questions tagged [objectdatasource]

ObjectDataSource control acts as a data interface for databound controls such as: GridView, Repeater, FormView and DetailsView.

618 questions
7
votes
6 answers

GridView not Rebinding Properly After Postback

I have a GridView that has a DataSourceID pointing to an ObjectDataSource. The ObjectDataSource points to a method that returns a LINQ IQueryable by using the TypeName, SelectMethod, and SelectCountMethod properties of the ObjectDataSource control.…
Jason N. Gaylord
  • 7,910
  • 15
  • 56
  • 95
7
votes
3 answers

Is it possible to stop ObjectDataSource from auto-binding?

I have a GridView to which I've using an ObjectDataSoure as the data source. The ObjectDataSource is taking in parameters from a TextBox and DropDownList which is then passed into the stored procedure. There is also a button called Search which can…
Rusty Wizard
  • 531
  • 6
  • 20
7
votes
3 answers

Could not find a property named 'xxx.yyy' in FormView (two-way binding for nested properties)

I have this error when I try to update a FormView Could not find a property named 'MainContact.FirstName' on the type specified by the DataObjectTypeName property in ObjectDataSource 'odsForm'. I think it is because I use in the EditTemplate a…
Vinzcent
  • 1,438
  • 6
  • 33
  • 59
7
votes
3 answers

How to Sort on a GridView using ObjectDataSource with TemplateFields

Background: I am working with a GridView and an ObjectDataSource. I am implementing Paging and Sorting. On the ObjectDataSource: objectDataSource.TypeName = value; objectDataSource.SelectMethod = "Select"; …
Jonathan Mitchem
  • 953
  • 3
  • 13
  • 18
6
votes
3 answers

DataBind and Postback

This is a general how does DataBind work questions... I have a simple page with a GridView that is bound (in the aspx code) to an ObjectDataSource. I can look in the Select() function called by the ObjectDataSource to see that it is called on the…
Michael La Voie
  • 27,772
  • 14
  • 72
  • 92
6
votes
3 answers

Understanding ObjectDataSource and Select Parameters

I have in a GridView control a TemplateField like:
balexandre
  • 73,608
  • 45
  • 233
  • 342
5
votes
3 answers

How does FormView EditTemplate update values in ObjectDataSource UpdateParameters under the hood?

I have a FormView bound to an ObjectDataSource. * ObjectDataSource definition (omitted portion of it for simplicity)*
Leo Nix
  • 2,085
  • 2
  • 24
  • 37
5
votes
4 answers

FormView ConvertEmptyStringToNull and binding

I'm using a FormView with an ObjectDataSource and binding using <%# Bind("WhateverProp") %> - and all of my nullable columns are coming back with default values of the type in them. It appears that the FormView object doesn't have a…
Scott Ivey
  • 40,768
  • 21
  • 80
  • 118
5
votes
3 answers

How to handle an exception is thrown by Select method of ObjectDatasource?

I have a Select method connected to an ObjectDatasource, this method might throw an exception and I don't know how to handle it! The problem is that I'm not controlling it. When the page is rendered then the select method is called directly by the…
French Boy
  • 1,471
  • 3
  • 18
  • 23
5
votes
2 answers

asp.net objectdatasource pass parameter from control as well as textbox

I have configured a GridView to fill data by an ObjectDataSource. This ObjectDataSource requires only one parameter which is bound to a DropDownList. This all works well. When i load the page, it fills the DropDownList and whatever field is…
Shezi
  • 1,352
  • 4
  • 27
  • 51
5
votes
2 answers

Gridview disappears on postback when paging is enabled

I have a gridview that has its DataSourceID property set to a custom ObjectDataSource object. When AllowPaging is set to True, the GridView disappears after a postback. If I set AllowPaging to False it's fine. Can someone shed some light on this for…
adam0101
  • 29,096
  • 21
  • 96
  • 174
5
votes
1 answer

Why does ValueMember override an empty DisplayMember

When I set a DataSource on a control and want to use .ToString() as DisplayMember, I need to set the DisplayMember last or the ValueMember will override it. MSDN on empty string as display member: The controls that inherit from ListControl can…
EpicKip
  • 4,015
  • 1
  • 20
  • 37
5
votes
1 answer

Modifying a collection returned from ObjectDataSource

Some quick background on what I'm working on: I've got a page with a RadGrid tied to an ObjectDataSource that returns a collection of objects On that page; I also have two lists; one contains Ids of objects that need to merged with the collection…
Jim B
  • 8,344
  • 10
  • 49
  • 77
5
votes
2 answers

If ObjectDataSource isn't the answer for a large application, what is?

Quoting the answer of Andrew Hare on the This Question. Object data sources are nice for small projects but they do not scale well as you are embedding data-layer information in the UI layer of your application. I would suggest that you …
Mazen Elkashef
  • 3,430
  • 6
  • 44
  • 72
5
votes
1 answer

ObjectDataSource Delete problems

Enviroment: asp.net framework 2.0 I'm having problems with the Delete method of and ObjectDataSource on a custom object. The Select, Insert and Update methods works fine. Here is the code of the classes: public class Car { public string ID {get;…
Andres A.
  • 1,329
  • 2
  • 21
  • 37
1
2
3
41 42