Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 Development Tools
 ASP.NET
 Way to hide rows in 1.1 datagrid?

Author  Topic 

bubberz
Constraint Violating Yak Guru

289 Posts

Posted - 2006-11-08 : 09:27:06
When I click "Edit" on a row in a 1.1 datagrid, is there a way to set all the other rows to Visible=False or something along those lines. I'd like to hide all other rows. I don't want to post to another page for the edit since there are multiple filters on this page.

In the edit command for the datagrid I'm trying to do following, but no luck:

DataGrid1.EditItemIndex = e.Item.ItemIndex
If DataGrid1.EditItemIndex <> e.Item.ItemIndex Then
DataGrid1.ItemStyle.....something
End If

I've tried setting the font or height, but it's not making a difference.

bubberz
Constraint Violating Yak Guru

289 Posts

Posted - 2006-11-08 : 09:43:49
No luck with this either.
I have this in the datagrid's ItemCommand handler:

DataGrid1.EditItemIndex = e.Item.ItemIndex

If e.Item.ItemType = ListItemType.Item Or e.Item.ItemType = ListItemType.Item Then

If DataGrid1.EditItemIndex <> e.Item.ItemIndex Then

e.Item.Visible = False

End If

End If

'...code that builds datgrid

Call BuildDG()
Go to Top of Page

bubberz
Constraint Violating Yak Guru

289 Posts

Posted - 2006-11-08 : 10:08:28
Tried this in Itemdatabound, but no luck still:

If e.Item.ItemType = ListItemType.EditItem Then
If DataGrid1.EditItemIndex <> e.Item.ItemIndex Then
e.Item.Visible = False
End If
End IF
Go to Top of Page

elwoos
Master Smack Fu Yak Hacker

2052 Posts

Posted - 2006-11-09 : 03:16:19
Off the top of my head could you just set a filter to the edited row and then rebind and set the edititem. Think you would need to do it in the edititem command

steve

-----------

Don't worry head. The computer will do all the thinking from now on.
Go to Top of Page
   

- Advertisement -