objectdatasource

How do I Prevent FormView from clearing user's entered Values after Insert Method has fired?

I have been struggling with getting FormViews to work the way Microsoft expects me to for about a day and have figure a bunch of great stuff out. I can catch e.Exception and e.ReturnValue in the ObjectDataSource.Inserting Event Handler and I can even cheat and check other properties of the Object in the ObjectDataSource.ObjectDisposing ...

Objectdatasource Gridview Paging Bug

I have a gridview bound to an objectdatasource which handles paging. This all works great until there is less rows to display than the paging allows. In my case the paging is set to 50 but there are only 30 rows to display. The grid renders correctly but i have (1 2 3 4 ...) pages displayed in the grid. When you select a page it returns ...

I would like to reuse the ObjectDataSource. How can i?

I mean I have a gridview in aspx. Then I have the ObjectDataSource. It's binding, it looks all right. Got paging allow = true also. I don't want to go again to the database for the same datatable (ObjectDataSource's Selectmethod), so I'd like to do something like: DataTable dt = ObjectDataSource.GetOriginalDataTableLoadedFrom(); Atr...

Overwriting ControlParameters of DataSources in code-behind

I have an ObjectDataSource (but perhaps this question is the same for all kinds of DataSources which support parameter collections): <asp:ObjectDataSource ID="MyObjectDataSource" runat="server" TypeName="MyData" OldValuesParameterFormatString="original_{0}" SelectMethod="GetMyData" > <SelectParameters> <asp:Con...

Asp.net's ObjectDataSource data bind event

Hi there I'm Working on an Asp.net/C# application. I want to bind a list of objects to a grid view. I've been looking a while to the ObjectDataSource control and it loads data to my datagrid as soon as my page loads. Can I change this behaviour? For example, how can I set DataBinding only when a button on my page gets clicked? tks ...

DevExpress AspxGridView filter in ObjectDataSource

Yet another problem with DevExpress AspxGridView :) The context: One Page In the Page, a custom control In the custom Control, a AspxDropDown The AspxDropDown, has a DropDownWindowTemplate In the DropDownItemTemplate, I add a GridView and a paging/sorting/filtering enabled ObjectDataSource When handling the Selecting event of the Obje...

Where does the ObjectDataSource cache data?

I'm considering using an ObjectDataSource as an intermediate between my page controls and my data access layer & object model. Traditionally I have manually created the object and populate it via a series of findcontrol statements when I need to insert/update data in the database. I'm hoping that I can use the ObjectDataSource to marsh...

How to retain the values of the filters and its result using asp.net c#?

Question:- Page is a typical search page with few filters on it. When search for records based on filters, it shows result in Gridview. From grid view records, user can click on any record to see the details which takes the focus on new page. Its working fine so far. Now when user comes back from details page to search page. I am loosi...

SqlDatasource releases any resources (such as connections) if an error occurs. Is same true for ObjectDataSource?

SqlDatasource releases any resources (such as connections) if an error occurs. Is the same true for ObjectDataSource? Thus does ODS automatically close the database connection if an error occurs? thanx ...

Problems with Optimistic Concurrency through an ObjectDataSource and a GridView

Hi I'm having a problem in an ASP .NET 2.0 Application. I have a GridView displaying data from an ObjectDataSource (connected to a BLL class which connects to a TabledAdapter (Typed Dataset using optimistic concurrency). The select (displaying the data) works just fine, however, when I update a row the GridView does pass the old value...

How do I initialize the controls in an InsertItemTemplate?

I have - for instance - an asp:FormView which supports Read, Insert, Update, Delete and is bound to a DataSource: <asp:FormView ID="FormView1" runat="server" DataSourceID="ObjectDataSource1" > <ItemTemplate> <asp:Label ID="Label1" runat="server" Text='<%# Bind("MyText") %>' /> </ItemTemplate> <EditItemTemplate> ...

How can I get compilation failures if objectdatasource's are not properly wired up?

I have a large brown field webforms app that uses ObjectDatasource controls all over the place, which makes refactoring more difficult than it should be. Is there a way to get a comile-time failures if an object or method is renamed which would cause the ObjectDataSource no longer work? In MVC there is the notion of compiling views, is ...

ObjectDataSource UpdateMethod passing updated values

I've got a gridview connected to an objectdatasource which is bound to some custom objects in my code (code is below). The problem I'm having is that the value passed into my update method is the old value, not the new value. Thoughts? Imports System.Configuration Imports System.Web.Configuration Imports System.Security.Cryptography Imp...

How to cancel binding ObjectDataSource ?

CheckPara is my OnDataBinding procedure SqlDataSource1 is ObjectDataSource (it's only confusing name) Language is Nemerle, but if you know C# you can read it easy protected virtual CheckPara(_ : object, _ : System.EventArgs) : void { foreach(x is Parameter in SqlDataSource1.SelectParameters) when(x.Default...

Operation can only be performed on rows that belong to a DataGridView control?

it happens when i change the DataSource. i have checked everything(stack traces, all exception information, datasources, grids, all the threads, etc) i have also write lots of diagnostic code(+3000 line) it seems to be a virus, it is going to destroy everything in my app. all grids are going to have the very same error.(while i have not...

Why does the UpdateMethod in ObjectDataSource only receive values for properties from visible controls in DetailsView?

I've written a class that contains Select- and Update-Methods for an ObjectDataSource. The UpdateMethod receives an instance of a called class. My problem is, that only properties that are Bound in the DetailsView are set, the others have their default value. Here's my code: Class declaration: public class Foo { public string Prop...

How to fill an inner gridview based on outer gridview selection (ASP.NET/C#)

I have 2 GridViews, the InnerGridView is nested inside a TemplateField of my OuterGridView. Each GridView has an ObjectDataSource (ODS). I want the InnerGridView to display data that is unique to the GroupName that is listed in the OuterGridView. I have been Googling this for weeks, seeing various ideas based around RowDataBound and the ...

Recommendations, Asp.Net ObjectDataSource bind result of webservice call

I need recommendations on how to solve / structure a solution to the following problem. In an asp.net web application i'll have to visualise results returned from a web service call. Im planning to use a repeater server control and bind this with an objectdatasource. The service returns a result of the form: public class SearchResul...

ObjectDataSource Update/Delete parameters from GridView

<asp:ObjectDataSource ID="MMBRSODS" runat="server" OldValuesParameterFormatString="original_{0}" TypeName="Flow_WEB_Nemerle.SQLModule" SelectMethod="GetMembers" UpdateMethod="UpdateMember" DeleteMethod="DeleteMember"> <UpdateParameters> <asp:Parameter Name="UserName" Type="String" /> </UpdateParameters> <DeleteParameters> <...

Make an column from ObjectDataSource to GridView ReadOnly

protected virtual GridView1_DataBound (_sender : object, _e : System.EventArgs) : void { GridView1.Columns[1].READONLY=TRUE; } Something like that :-S GridView got dynamic columns ... but maybe I can do ReadOnly columns static ... maybe ... Thank you ...