Ajith George

HI ALL,

I am using Gridview in webpart to Display a items from list, i need Update action in that gridview same the way what we do in web application.But i 'm facing problem once i add a coomand field, and after putting Show Edit Button = true, i m getting edit event also"

gridview.RowEditing += new GridViewEditEventHandler(gridview_RowEditing);

but once after that i edit the items and click on Update the Update Event is not Firing..

Wat is the reason for this ..had i left some to be done..

Please Help......

i have already posted this query in forums..



Re: SharePoint - Development and Programming Using Gridview in Webpart....

Joseacarras

Maybe you should try using a list event handler. In this page you could check the events available on lists. http://sharethispoint.com/archive/2006/07/28/16.aspx





Re: SharePoint - Development and Programming Using Gridview in Webpart....

James Yarnell

Most likely you need to add your grid view to the web parts Controls collection. No events will fire unless the control is in there.

Cheers





Re: SharePoint - Development and Programming Using Gridview in Webpart....

Ajith George

Hi james,Thanks for Reply....i have added the control to webpart.. like "this.controls.add(myGridview)"...is that wat u mean or is there anything else left..Other events like selectedindexchanged is working fine

Thanks In Advance,

Ajith George





Re: SharePoint - Development and Programming Using Gridview in Webpart....

newkie50000

It could be an order of execution problem. Create the grid and register its events in CreateChildControls().

// create a new Grid
m_dgStaff = new DataGrid();
Controls.Add(m_dgStaff);
//Configure the grid
m_dgStaff.AllowSorting = true;
m_dgStaff.SortCommand += new DataGridSortCommandEventHandler(dgStaff_Sort);






Re: SharePoint - Development and Programming Using Gridview in Webpart....

fedroponce

I would say that the GridView object is not there when the postback event occurs... so the event wont fire.

You should review your code and double check that the GridView control still exists (or create it again) when the page postbacks. This way the event will fire.