Manually Databinding a GridView

Posted by: Aaron Goldenthal 4/19/2009 9:36 PM

One of the questions I see frequently on the ASP.NET forums is how to deal with exceptions like The GridView 'GridView1' fired event RowEditing which wasn't handled. The GridView 'GridView1' fired event PageIndexChanging which wasn't handled. The GridView 'GridView1' fired event Sorting which wasn't handled. The GridView 'GridView1' fired event RowDeleting which wasn't handled. when manually databinding a GridView.  When I say manually databinding I mean not using a data source co... [More]
Tags: ,
Categories: Data Controls
E-mail | Kick it! | DZone it! | del.icio.us Permalink | Comments (37) | Post RSSRSS comment feed

How to Change the Selected Value of a <select> in Javascript and Raise the onchange Event

Posted by: Aaron Goldenthal 4/12/2009 5:07 PM

I had a project recently where I wanted to change the selected value of an ASP.NET DropDownList via Javascript and force a postback to trigger an UpdatePanel refresh.  Since AutoPostBack was set to true for the DropDownList, I expected the postback to occur automatically.  What I learned through this is that the select’s change event is only fired when the user changes the selection, not when it’s done through Javascript, so the postback never occurred.  After a little... [More]
Tags: ,
Categories: Javascript
E-mail | Kick it! | DZone it! | del.icio.us Permalink | Comments (7) | Post RSSRSS comment feed

A Custom LinkButton for the ASP.NET Calendar

Posted by: Aaron Goldenthal 4/10/2009 8:56 PM

A couple of weeks ago I posted an article on creating a dynamic button in an ASP.NET Calendar.  The one aspect of that solution that wasn’t quite as clean as I would have liked is how the data key for the button that was clicked was determined.  To remedy that, I’ve created a custom server control that inherits from LinkButton, but provides some customization for this particular application. Specifically, this control: Retains all functionality of the original LinkButton Add... [More]
Tags: ,
Categories: Calendars
E-mail | Kick it! | DZone it! | del.icio.us Permalink | Comments (2) | Post RSSRSS comment feed

Create Dynamic Buttons in an ASP.NET Calendar

Posted by: Aaron Goldenthal 3/31/2009 2:56 PM

As you get more familiar with the ASP.NET calendar, eventually you start tweaking it: adding your own styles, using the DayRender event to customize the content of each day, etc.  At some point you may try to dynamically create a button during DayRender, at which point you see the button render on the client, but when it’s clicked, no event fires.  This article will give you a solution to work around this problem. Why Adding Buttons During DayRender Fails Some people who start using... [More]
Tags:
Categories: Calendars
E-mail | Kick it! | DZone it! | del.icio.us Permalink | Comments (19) | Post RSSRSS comment feed

ASP.NET Databinding Bind() Method Dissected

Posted by: Aaron Goldenthal 3/15/2009 10:00 PM

I was thinking about a question on the asp.net forums recently and while doing a little research I learned a few things about how the databinding Bind() method really works, and a few of the limitations. The Bind() methods performs two functions: Extract values during databinding to populate properties of a control (done via the same method used by the Eval() method) Extract values from controls (e.g. to perform insert/update operations) I’ve set up a quick example to illustrate ho... [More]
Tags:
Categories: Data Controls
E-mail | Kick it! | DZone it! | del.icio.us Permalink | Comments (10) | Post RSSRSS comment feed