This is a discussion on "User Controls in Datagrids" within the ASP.NET Forum section. This forum, and the thread "User Controls in Datagrids are both part of the Program Your Website category.
|
|
|
|
|
![]() |
||
User Controls in Datagrids
|
||
| Notices |
![]() |
|
|
LinkBack | Thread Tools |
|
|||
|
Hi again,
I have developed user control that I can put on a page and it works no problem. However, when I pull data out of a dataset into a datagrid and put user control within a template column, the control displays, but doesn't work; as in it cannot keep its state when it is supposed to do something. This is my templateColumn...
For your information, my control displays an image from a database with an "Edit" button. When the button is clicked it then should display a file upload field. Any ideas? Thanks, Steve |
|
|
|
|||
|
Re: User Controls in Datagrids
Off the top of my head, I think this is because when your control is clicked in the datagrid the postback cannot find the usercontrol because is is nested in the template. I dont know if this is gonna work, but look into the FindControl() method. Also what ?might? be if use is the OnItemDatabound event of the datagrid and casting your user control.
Hope that is of some help |
|
|||
|
Thanks for your reply. It was useful, however didn't cure my problem hehe.
By my usual method of fixing bugs by sheer random acts of programming, I decided to stick if statements around my BindDataGrid method to see what happens...
Steve |
![]() |
| Tags |
| user, controls, datagrids |
| Thread Tools | |
|
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| ASP.NET Chart Controls | marketer2007 | ASP.NET Forum | 1 | May 21st, 2008 21:09 |
| fl.controls.ComboBox could not be found | grahame | Flash & Multimedia Forum | 6 | Sep 21st, 2007 18:00 |
| web controls in aspx | ketansethi | ASP.NET Forum | 0 | Aug 12th, 2007 09:46 |
| ActiveX Controls | vnswathi | JavaScript Forum | 0 | May 22nd, 2006 14:23 |
| Windowless controls / z-order | ttupper | Web Page Design | 4 | Nov 4th, 2005 14:54 |