Link to home
Start Free TrialLog in
Avatar of kpankaj9
kpankaj9

asked on

Datagrid events dont fire

I have created a datagrid dynamically,the grid displays perfect...except that events dont fire. First time when the page loads ItemCreated and ItemDataBound events dont fire, When I click on any sort expession ,now I could see(using brakepoints) the events the firing..but here also after the code is executed neither sorting in the header column is performed nor totals are displyed in the footer. I tried almost everything ..like placing the event handlers,CreateGrid method in IntializeComponent() and everything I could find on net.Can anybody pls help??
Avatar of nauman_ahmed
nauman_ahmed
Flag of United States of America image

Check the following article:

Creating DataGrid BoundColumn ButtonColumn HyperLinkColumn at Runtime in Asp.net
http://www.codeproject.com/useritems/datagridcloumns.asp

--Nauman.
Can I ask what might be reason for dynamically creating a datagrid? if the grid needs to be shown conditionally, you can always use the "visible" property of the grid ..

dynamic controls are not so easy to work with .. also note that dynamic controls are NOT automatically created for every postback and so you will have to keep a track whether the datagrid was created in the previous postback and create it again in page "LOAD" or "INIT" event ..

Rejo
Avatar of kpankaj9
kpankaj9

ASKER

Can anybody pls help, am I missing any page specific property or page level setting,I even created the same grid with nested grids but still having the exact same problem??Can any expert out thr help me with this as it is holding me up from moving further.
Hi Rejojohny
I created the grid at design time ,every thing works fine but later I had to change it to dynamic bec I have to show multiple grids based upon the currencies in the database. I cannot hardcode the no. of grids as tommorow the no. of currencies(USD,EUR) may increase for the client...I hope u get my point...
ASKER CERTIFIED SOLUTION
Avatar of nauman_ahmed
nauman_ahmed
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Forced accept.

Computer101
EE Admin