Sign In| Join
Get Help:Ask a Question in our Forums|Report a Bug|More Help Resources
All-Star
53942 Points
8147 Posts
Jun 26, 2010 06:42 PM|LINK
What I understood from your description was
You are using a nested gridview in which you are doing a postback to load some child gridview and once you select the row in the child gridview,
You want to hide the others.
You can do like this
find the Child gridview in the code behind and in the selectedIndexChangedEvent,
find the Gridviewrow selected and then
gv.Rows.OfType<GridViewRow>().ToList().Where(a=>a.RowIndex !=row.RowIndex).ToList().ForEach(b=>b.Visible=false)
it will get all the rows in teh child gridview and hide all rows except the row selected.
Correct me if I understood your requirement wrong.
sansan
All-Star
53942 Points
8147 Posts
Re: GridView Select
Jun 26, 2010 06:42 PM|LINK
What I understood from your description was
You are using a nested gridview in which you are doing a postback to load some child gridview and once you select the row in the child gridview,
You want to hide the others.
You can do like this
find the Child gridview in the code behind and in the selectedIndexChangedEvent,
find the Gridviewrow selected and then
gv.Rows.OfType<GridViewRow>().ToList().Where(a=>a.RowIndex !=row.RowIndex).ToList().ForEach(b=>b.Visible=false)
it will get all the rows in teh child gridview and hide all rows except the row selected.
Correct me if I understood your requirement wrong.