View Single Post
  #2 (permalink)  
Old May 29th, 2007, 04:58 PM
zak_willis zak_willis is offline
Registered User
 
Join Date: May 2007
Location: London, , United Kingdom.
Posts: 2
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via MSN to zak_willis
Default

Hi there. I won't be posting my code as it is probably over-excessive, but I can tell you how to solve this. The basic problem is that the asp.net 1.1 datagrid doesn't really come up to scratch. Yes, sure you can click an edit column and make it appear as a text box column but what you really want is to be able to have textboxes, checkboxes and dropdowns, you need to be able to create dynamic template columns. I don't think many people would not want to have some form of dynamism as opposed to setting the templates up manually.
For this you need to implement the Itemplate interface and use the Instantiate in method. This allows you to add a textbox, combobox, etc at runtime and set the value to the value of the databinder. A handler is then created that adds the relevant control to the datagridcell. The end result is a datagrid of editable text boxes etc.


Zak Willis
Managing Director of www.blue-rhino.co.uk