Click here to Skip to main content
15,898,371 members
Home / Discussions / ASP.NET
   

ASP.NET

 
AnswerRe: Displaying data on a gridview Pin
VanithaVasu6-Aug-07 21:58
VanithaVasu6-Aug-07 21:58 
GeneralRe: Displaying data on a gridview Pin
Sonia Gupta6-Aug-07 21:25
Sonia Gupta6-Aug-07 21:25 
GeneralRe: Displaying data on a gridview Pin
Mamphekgo Bahula6-Aug-07 21:45
Mamphekgo Bahula6-Aug-07 21:45 
AnswerRe: Displaying data on a gridview Pin
N a v a n e e t h6-Aug-07 22:48
N a v a n e e t h6-Aug-07 22:48 
QuestionMaintain values of Dynamic Dropdownlists in datagrid Pin
VanithaVasu6-Aug-07 20:46
VanithaVasu6-Aug-07 20:46 
AnswerRe: Maintain values of Dynamic Dropdownlists in datagrid Pin
gauthee6-Aug-07 20:54
gauthee6-Aug-07 20:54 
GeneralRe: Maintain values of Dynamic Dropdownlists in datagrid Pin
VanithaVasu6-Aug-07 21:20
VanithaVasu6-Aug-07 21:20 
AnswerRe: Maintain values of Dynamic Dropdownlists in datagrid Pin
N a v a n e e t h6-Aug-07 22:37
N a v a n e e t h6-Aug-07 22:37 
VanithaVasu wrote:
Now i want to add new row to the datagrid and when i add i create a row dynamically.
But the values in the previous rows disappear. How do i maintain the selected values of the controls during runtime even if i add aor delete rows.


To understand your problem you need to be familiar about how ASPX page works and ASP.NET page lifecycle. MSDN is having good articles regarding this.

Regarding your problem, You are not getting previous values when new row added because, ASP.NET is not maintaining viewstate for your control. This is happening because you are creating dynamic columns somewhere after Init event. When an ASPX page processes, it will store viewstates in Init event. So whatever dynamic controls created after this event won't maintain viewstate.

To solve your problem, try creating the rows in page_init event. Remember when you create controls in init event, no need to check isPostBack


QuestionAuthentication class Pin
N a v a n e e t h6-Aug-07 20:37
N a v a n e e t h6-Aug-07 20:37 
AnswerRe: Authentication class Pin
VanithaVasu6-Aug-07 21:09
VanithaVasu6-Aug-07 21:09 
GeneralRe: Authentication class Pin
N a v a n e e t h6-Aug-07 22:26
N a v a n e e t h6-Aug-07 22:26 
QuestionCheckBox in a DataGrid? Pin
chand106-Aug-07 20:27
chand106-Aug-07 20:27 
AnswerRe: CheckBox in a DataGrid? Pin
N a v a n e e t h6-Aug-07 20:43
N a v a n e e t h6-Aug-07 20:43 
QuestionWhat is Smart Client Application in ASP .NET ? Pin
Arindam Tewary6-Aug-07 20:26
professionalArindam Tewary6-Aug-07 20:26 
AnswerRe: What is Smart Client Application in ASP .NET ? Pin
Christian Graus6-Aug-07 20:53
protectorChristian Graus6-Aug-07 20:53 
QuestionWhat is the significance of the new ASP.Net directories Pin
rockyl6-Aug-07 20:23
rockyl6-Aug-07 20:23 
AnswerRe: What is the significance of the new ASP.Net directories Pin
N a v a n e e t h6-Aug-07 20:51
N a v a n e e t h6-Aug-07 20:51 
QuestionUsing PrintOutOld Pin
gauthee6-Aug-07 20:23
gauthee6-Aug-07 20:23 
AnswerRe: Using PrintOutOld Pin
Vasudevan Deepak Kumar6-Aug-07 23:12
Vasudevan Deepak Kumar6-Aug-07 23:12 
QuestionError CS1002: ; expected Pin
JacquesDP6-Aug-07 20:19
JacquesDP6-Aug-07 20:19 
AnswerRe: Error CS1002: ; expected Pin
JacquesDP6-Aug-07 20:22
JacquesDP6-Aug-07 20:22 
GeneralRe: Error CS1002: ; expected Pin
Vasudevan Deepak Kumar6-Aug-07 23:11
Vasudevan Deepak Kumar6-Aug-07 23:11 
GeneralRe: Error CS1002: ; expected Pin
JacquesDP6-Aug-07 23:37
JacquesDP6-Aug-07 23:37 
Question.Net Frame work Pin
sujtha6-Aug-07 19:48
sujtha6-Aug-07 19:48 
AnswerRe: .Net Frame work Pin
Christian Graus6-Aug-07 20:26
protectorChristian Graus6-Aug-07 20:26 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.