Welcome Guest Search | Active Topics | Sign In | Register

Delete several items with a double-key Options
Joffrey
Posted: Friday, January 25, 2008 3:37:57 AM
Rank: Newbie
Groups: Member

Joined: 1/25/2008
Posts: 3
I use your example “CheckBox Column” that lets you delete item of the grid. I would like to know how to delete these items also in my database. To remove the items I need two keys that are not displayed in the grid, I can put them in a non-visible or not ?

-
JL
eo_support
Posted: Friday, January 25, 2008 6:11:24 AM
Rank: Administration
Groups: Administration

Joined: 5/27/2007
Posts: 24,090
Hi Joffrey,

The Grid can store one non-visible KeyField for you:

http://www.essentialobjects.com/ViewDoc.aspx?t=EO.Web.Grid.KeyField.html

If you need two, you can create a computed field based on those two fields in your SQL statement, using something like "SELECT KEY_FIELD1 + KEY_FIELD2 as KEY_FIELD, ....".

Thanks
Joffrey
Posted: Monday, January 28, 2008 4:09:38 AM
Rank: Newbie
Groups: Member

Joined: 1/25/2008
Posts: 3
Hello,

Thank you very much for your answer.
Now I use a single key but I can’t recover it for the line that I want. This is my code:

protected void Button1_Click(object sender, EventArgs e)
{
foreach (GridItem item in this.Grid1.DeletedItems)
{
// The key of item is ???
}
}

It’s possible to recover the key of “item” that I want ?
eo_support
Posted: Monday, January 28, 2008 5:14:16 AM
Rank: Administration
Groups: Administration

Joined: 5/27/2007
Posts: 24,090
Hi Joffrey,

Please check the reference page in my previous page. The same contents are also available as a .chm file on your local machine. It's explained quite clear there!

Thanks


You cannot post new topics in this forum.
You cannot reply to topics in this forum.
You cannot delete your posts in this forum.
You cannot edit your posts in this forum.
You cannot create polls in this forum.
You cannot vote in polls in this forum.