I suppose my eyes got big when I saw all the new properties and methods, and wanted to try them all out. Most articles I found were for hardcoded datasources (especially on MSDN, ugh) and didn’t really help me much, so this post will be referring to Grid Views with dynamically bound datasources. First, create a Grid View with three bound columns and an Update/Edit/Cancel (Command Field) column: Nothing in there should be shocking to anyone: all your events are handled, you have a Hyper Link Field that uses the Data Navigate URLFields property to insert a Product ID, and you have set your Data Key Names property to your hidden field which holds your Product ID. Width will be taken from the table’s width attribute, so make sure the table you’re passing in has got a width attribute.If width is specified in percentage, it will be calculated in regards to width of the document body, and not of the containing element (ie parent Node).You can see the C# code below will give the row number whatever you are editing by New Edit Index property.
If your existing code has reliance on window.onresize event, please amend the fx file. To enhance this process, be sure to include your Grid View in an AJAX Update Panel. Everything should be sorted out when the “Update” link is pressed.If your table is generated by a framework like JSF or ASP.net, you’ll need to avoid any possible ID collision as discussed on my previous post.Today was spent mostly tackling the Grid View’s Update/Edit functionality, and I got incredibly frustrated, at first. So be sure to rebind your Grid View at the end of your event handler. I’ve got a pretty good handle on it as I’ve been doing it for several years, and can help with a lot, but I definitely don’t claim to know everything.