Monday, August 16, 2010

I am writing webpart (sharepoint) in C# - how to update multiple rows displayed in datagrid?

WEbpart is in C# -


I have code to display the list in datagrid - few columns are editable.


now i have a button to update all the rows - one button save - should give me access to datagrids -





I get nothing in the datagrid.items.





ThanksI am writing webpart (sharepoint) in C# - how to update multiple rows displayed in datagrid?
In the event handler for the button click event, be sure to call the .DataBind method on the datagrid.





To retrieve the values from within controls in template columns, create a handler for the OnItemDataBound event, then find the controls by ID for each row.





One bit if advice - make sure you check the Item.ItemType. You wont find the control you're looking for if the ItemType is a Header or Footer.

1 comment:

Anonymous said...

To update multiple rows in data grid remove data group in header of group , it will result in multiple grouping and will fill corresponding collection in the data grid header.for more information read this.
http://www.dapfor.com/en/net-suite/net-grid/features/headers-and-columns

Post a Comment