473,480 Members | 1,781 Online
Bytes | Software Development & Data Engineering Community
Create Post

Home Posts Topics Members FAQ

parameters and databinding (gridview)

Hi all,

I have a DataSource linked to a gridview and have delete functionality
on the gridview
The objectdatasource looks like this:
<asp:ObjectDataSource ID="TestsObjectDataSource" runat="server"
DeleteMethod="DeleteTest"
SelectMethod="GetAllTests" TypeName="DaVinci.Controller">
<DeleteParameters>
<asp:Parameter Name="Id" Type="Int32" />
</DeleteParameters>
</asp:ObjectDataSource>

The delete parameter is Id. When I push delete (and debug) nothing gets
deleted cos the id is always 0. I actually want to pass the id of the
row but I cannot find how to achieve this. How can i define what value
is taken for the id?

Someone has a clue?

Thanks in advance
Stijn

Oct 24 '06 #1
2 1250

For delete, Delete will work automatically by picking ID from Grid
Keyfields. Make sure that your GridView has keyfields defined.

Shahzad Godil
Karachi-Pakistan.

<ta******@gmail.comwrote in message
news:11*********************@e3g2000cwe.googlegrou ps.com...
Hi all,

I have a DataSource linked to a gridview and have delete functionality
on the gridview
The objectdatasource looks like this:
<asp:ObjectDataSource ID="TestsObjectDataSource" runat="server"
DeleteMethod="DeleteTest"
SelectMethod="GetAllTests" TypeName="DaVinci.Controller">
<DeleteParameters>
<asp:Parameter Name="Id" Type="Int32" />
</DeleteParameters>
</asp:ObjectDataSource>

The delete parameter is Id. When I push delete (and debug) nothing gets
deleted cos the id is always 0. I actually want to pass the id of the
row but I cannot find how to achieve this. How can i define what value
is taken for the id?

Someone has a clue?

Thanks in advance
Stijn

Oct 24 '06 #2
Thanks for the reply. By setting the DataKeyNames="Id" The Id got send
correctly to the delete methode.
On Oct 24, 12:45 pm, "Shahzad Godil" <shahzadgo...@gmail.comwrote:
For delete, Delete will work automatically by picking ID from Grid
Keyfields. Make sure that your GridView has keyfields defined.

Shahzad Godil
Karachi-Pakistan.

<tarsc...@gmail.comwrote in messagenews:11*********************@e3g2000cwe.goo glegroups.com...
Hi all,
I have a DataSource linked to a gridview and have delete functionality
on the gridview
The objectdatasource looks like this:
<asp:ObjectDataSource ID="TestsObjectDataSource" runat="server"
DeleteMethod="DeleteTest"
SelectMethod="GetAllTests" TypeName="DaVinci.Controller">
<DeleteParameters>
<asp:Parameter Name="Id" Type="Int32" />
</DeleteParameters>
</asp:ObjectDataSource>
The delete parameter is Id. When I push delete (and debug) nothing gets
deleted cos the id is always 0. I actually want to pass the id of the
row but I cannot find how to achieve this. How can i define what value
is taken for the id?
Someone has a clue?
Thanks in advance
Stijn
Oct 24 '06 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
2802
by: dieter | last post by:
Two-way databinding (as described in http://dotnetjunkies.com/QuickStartv20/aspnet/doc/data/templates.aspx) works fine for me if I use it within aspx-files. However, I would like to use it my...
8
2162
by: GaryDean | last post by:
We have been noticing that questions on vs.2005/2.0 don't appear to get much in answers so I'm reposting some questions posted by some of the programmers here in our organization that never got...
9
24750
by: J055 | last post by:
Hi I have a very simple configuration of the GridView with paging and sorting. When I do a postback the DataBinding event fires twice - in both the ProcessPostData and PreRender stages of the...
1
14296
by: CorporateCoder | last post by:
Hi, I am trying to bind the selected value of a databound dropdown box in a databound gridview control to the value being displayed in the template column the dropdown box has been added to. ...
1
2153
by: H5N1 | last post by:
Hello I'm displaying report on a gridview through object data source which gets some parameters from ddl controls. Using sql profiler I've found out that even when controls are not yet set (by...
1
2755
by: Sergei Shelukhin | last post by:
I have the following problem with gridview. I use MySQL database that has Russian characters in cp1251 encoding, and I get ????????s instead of Russian characters on all my ASP.NET pages. To fix...
1
3450
by: Mundo | last post by:
Hi I'm pulling my hair out with a problem caused when DataBinding a DataSet to a web control. I first tried using a GridView but when that failed, I tried a Repeater. I'm getting the classic...
1
1729
by: Mark Olbert | last post by:
Has anyone else noticed that the design-time support for databinding in custom controls in ASPNET2 sucks? At least for GridViews? So far I've spent going on two days trying to get the following...
2
4905
by: DC | last post by:
Hi, I am trying to implement a simple template control (to be used as TemplateItem etc. in GridView). Does someone see why my code fails? I give up for now and try a different approach (http://...
0
6908
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
7048
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
7088
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
6956
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...
0
5342
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
1
4783
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 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 a new...
0
4485
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...
0
2997
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The...
1
563
muto222
php
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

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.