Click here to Skip to main content
15,880,543 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
I have some data source containing 4 column and then I bind these data to a gridview using databind. This makes rowcreated handler to be invoked. Is it possible to get the datasource data in the rowcreated handler function?

Thanks
Posted
Updated 20-Aug-11 7:18am
v2
Comments
Tarun.K.S 20-Aug-11 13:18pm    
Edit: Removed the unnecessary pre tags.
Wonde Tadesse 20-Aug-11 13:31pm    
Can you post some code ?

 
Share this answer
 
Comments
rakesh5454 21-Aug-11 2:33am    
this example tells how to find the rowindex for the gridview. But my problem is to get data of the new row in the RowCreated event handler.
u can get the complete row instance by

C#
e.Rows GridViewRow gr = e.Row;


each row has collection of cells

so to get instance of each cell u can u use e.Rows.Cells[index]

where index = column u want to access

for text of a cell string

C#
str = e.Row.Cells[0].Text; 


or

C#
e.Row.Cells[0].Text = "its me";
 
Share this answer
 
Comments
rakesh5454 22-Aug-11 6:21am    
This is fine but the data doesn't persists. In case of page reload data is not available.
dontumindit 22-Aug-11 14:11pm    
hmmmmmmmm try EnableViewState, set it to true

if not that, can u explain a bit more, what u trying to do, some code snip

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900