Complex Data Binding with the Accordion Control
page 4 of 6
by Brian Mains
Feedback
Average Rating: This article has not yet been rated.
Views (Total / Last 10 Days): 17654/ 283

Grid Selection

To setup selection for the grid, I changed the grid definition to the following:

Listing 10

<asp:GridView … AutoGenerateSelectButton="true" 
OnSelectedIndexChanging="gvwOrders_SelectedIndexChanging">

To select the grid when the grid is bound manually, the SelectedIndexChanging event needs handled so that the grid can be rebound to show the current selected item.

Listing 11

protected void gvwOrders_SelectedIndexChanging(object sender, 
GridViewSelectEventArgs e)
{
  GridView grid = (GridView)sender;
  HiddenField customerKeyField = (HiddenField)grid.FindControl("hdnCustomerKey");
  this.BindGrid(grid, new Guid(customerKeyField.Value));
}

Using the BindGrid refactoring, passing in the grid works well to incorporate two scenarios.  However, you do not really need to handle the selection approach from the grid (in a manual bind scenario).


View Entire Article

Article Feedback

Title:  
Name:  
Url: ( Optional )
Comment:  
Please add 2 and 8 and type the answer here:

User Comments

Title: Good Article......   
Name: WebEye
Date: 8/30/2008 5:51:42 AM
Comment:
Very good article...help me a lot.
You can find very much same article here...

http://www.aspdotnetcodes.com/Easy_Data_Binding_Accordion_GridView.aspx

And running example of this article here...

http://www.aspdotnetcodes.com/Accordion_Data_Binding_GridView_Example.aspx
Title: Nice Article   
Name: Imran Ahmad Mughal
Date: 7/8/2008 1:09:50 AM
Comment:
It's really a nice article. Can you please provide me the sample project in which you have implemented this?

Thanks
Title: Thanks   
Name: Subalakshmi
Date: 7/3/2008 6:39:09 AM
Comment:
A very Good article,to implement in my website.
Title: Thanks   
Name: Prashanth
Date: 7/3/2008 5:16:01 AM
Comment:
Great article, one small suggestion, if you have a sample application to download and some screen shots of the page it would be very helpful.

prashanthganathe@gmail.com
Title: Thank You :)   
Name: Qureshi
Date: 7/1/2008 9:20:20 AM
Comment:
hi

i realy want to say thanks

bcoz i really want a article on this

thaks a tan






Community Advice: ASP | SQL | XML | Regular Expressions | Windows


©Copyright 1998-2008 ASPAlliance.com  |  Page Processed at 12/2/2008 8:52:46 PM  AspAlliance Recent Articles RSS Feed
About ASPAlliance | Newsgroups | Advertise | Authors | Email Lists | Feedback | Link To Us | Privacy | Search