Click here to Skip to main content
15,907,001 members
Home / Discussions / ASP.NET
   

ASP.NET

 
GeneralRe: .aspx upload Pin
Amit Agarrwal25-Jul-06 20:48
Amit Agarrwal25-Jul-06 20:48 
QuestionError Handling with customErrors tag Pin
mrinmayeek25-Jul-06 8:41
mrinmayeek25-Jul-06 8:41 
Questionadded dynamic row with textbox to gridview but missing viewstate on postback Pin
silverfox_118825-Jul-06 8:15
silverfox_118825-Jul-06 8:15 
AnswerRe: added dynamic row with textbox to gridview but missing viewstate on postback Pin
ToddHileHoffer25-Jul-06 9:50
ToddHileHoffer25-Jul-06 9:50 
AnswerRe: added dynamic row with textbox to gridview but missing viewstate on postback Pin
silverfox_118825-Jul-06 11:50
silverfox_118825-Jul-06 11:50 
GeneralRe: added dynamic row with textbox to gridview but missing viewstate on postback Pin
ToddHileHoffer26-Jul-06 2:19
ToddHileHoffer26-Jul-06 2:19 
GeneralRe: added dynamic row with textbox to gridview but missing viewstate on postback Pin
silverfox_118826-Jul-06 19:11
silverfox_118826-Jul-06 19:11 
GeneralRe: added dynamic row with textbox to gridview but missing viewstate on postback Pin
Ista27-Jul-06 6:55
Ista27-Jul-06 6:55 
actually you shouldn't rebind.

store the table inside your view state

and on page load rebind to the table from viewstate.

theres no need to cache specific row data

private DataTable myTable = new DateTable(...);

pageLoad
if(!PostBack)
myTable = ... get the data from your biz layer ...;
ViewState["MyTable"] = myTable;
set data grid
else
DataGrid.DataSource = ViewState["MyTable"] as DataTable;
rebind

The reason why your changes are not shown is this.
First you create a table which has a unique identifier attached to it.
So you make changes and repost

When you get a new data table you have a different unique identifier which .net will wipe any changes and events tied to that source

You need to rebind every time, but use the table from the ViewState.

Also if you need to add format additional controls use the ItemCreated event to format them.

If you data bind them there, you shouldn't have a need to hack the form and make life difficult

Nick



--------------------------------------------------------

1 line of code equals many bugs. So don't write any!!

My mad coder blog

GeneralRe: added dynamic row with textbox to gridview but missing viewstate on postback Pin
silverfox_11882-Aug-06 5:03
silverfox_11882-Aug-06 5:03 
QuestionDataBinder output Pin
TheMajorRager25-Jul-06 8:00
TheMajorRager25-Jul-06 8:00 
AnswerRe: DataBinder output Pin
ToddHileHoffer25-Jul-06 9:45
ToddHileHoffer25-Jul-06 9:45 
GeneralRe: DataBinder output Pin
TheMajorRager25-Jul-06 11:36
TheMajorRager25-Jul-06 11:36 
QuestionDifference Pin
kjosh25-Jul-06 7:28
kjosh25-Jul-06 7:28 
AnswerRe: Difference Pin
Guffa25-Jul-06 8:20
Guffa25-Jul-06 8:20 
QuestionRedircet Page Pin
kirthikirthi25-Jul-06 7:07
kirthikirthi25-Jul-06 7:07 
AnswerRe: Redircet Page Pin
enjoycrack29-Jul-06 6:44
enjoycrack29-Jul-06 6:44 
QuestionCharts and graphs using .NET Pin
TheMajorRager25-Jul-06 6:52
TheMajorRager25-Jul-06 6:52 
AnswerRe: Charts and graphs using .NET Pin
minhpc_bk25-Jul-06 20:03
minhpc_bk25-Jul-06 20:03 
Questionbuild via coding Pin
sund7wells25-Jul-06 5:20
sund7wells25-Jul-06 5:20 
AnswerRe: build via coding Pin
RichardGrimmer25-Jul-06 5:53
RichardGrimmer25-Jul-06 5:53 
GeneralRe: build via coding Pin
sund7wells25-Jul-06 7:03
sund7wells25-Jul-06 7:03 
GeneralRe: build via coding Pin
RichardGrimmer25-Jul-06 7:11
RichardGrimmer25-Jul-06 7:11 
GeneralRe: build via coding Pin
sund7wells25-Jul-06 17:16
sund7wells25-Jul-06 17:16 
AnswerRe: build via coding Pin
Ista27-Jul-06 6:57
Ista27-Jul-06 6:57 
QuestionFiring the SortCommand Event AFTER change headers Pin
white.thief25-Jul-06 4:34
white.thief25-Jul-06 4:34 

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.