Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > ASP .Net > ASP .Net Datagrid Control > Datagrid Advice

Reply
Thread Tools

Datagrid Advice

 
 
Jeremy Martin
Guest
Posts: n/a
 
      05-29-2006
Hi,

I have a Master Detail Detail DataGrid which is setup like a dynamic
score card. The user clicks on the score "DataCell" and it fires a JS
onclick event which sets the property of a Hidden Input Type and
displays an appropriate image. "Visual representation of a mark eg tick
cross"

Now there us usually a couple of hundred possibilities on the form and
I cannot use Paging on the grid.


Example of HTML output of a Hidden Tag

<input name="TPG:_ctl9AG:_ctl3OG:_ctl2:1imgMark_h"
id="TPG__ctl9_PAG__ctl3_POG__ctl2_1imgMark_h" type="hidden" value="0" />


This setup works really well except for a couple of problems.

1. The viewstate is huge ~200K. I currently override the
SavePageStateToPersistenceMedium procedure and store it in a
SQLDatabase along with my Session Data. However I found that it takes
rougly 1 second to serialize and deserialize and uses alot of
processing power.

My alternative was download the whole Viewstate but on postback i got
viewstate corrupt errors.


2. I tried disabling the viewstate which ofcourse helps but now my
results do not get posted back and saved.


So I suppose the questions I have are.

Can I shrink the viewstate somehow by not storing everything about the
datagrid

OR

Should I be using an alternative method to save my results. Currently I
am doing below on OnInit whenever they click the save button. However
when ViewState is disabled on the datagrid none of items or controls
are available on PostBack.



for i := 0 to self.Items.Count -1 do
Begin
If (self.Items[i].itemType = ListItemType.Item) OR
(self.Items[i].itemType = ListItemType.AlternatingItem) OR
(self.Items[i].itemType = ListItemType.SelectedItem) Then
Begin

drp := self.Items[i].FindControl('OUTCOME_ATTITUDE') as
DropDownList;
if Assigned(drp) then
PriOutcomes :=
TPriOutcomes(OutComeData.Item[self.Items[i].ItemIndex]);
if PriOutcomes.Attitude then
PriOutcomes.Behaviour := drp.SelectedIndex;

PriOutcomes :=
TPriOutcomes(OutComeData.Item[self.Items[i].ItemIndex]);
for i2 := 3 to self.Columns.Count -1 do
Begin
placeholder := self.Items[i].Cells[i2].Controls[0] as
System.Web.UI.WebControls.PlaceHolder;
hid := placeholder.Controls[0] as
System.Web.UI.HtmlControls.HtmlInputHidden;
ViewState[hid.ClientID] := hid.Value;
levelidx := i2 - 2;
try
PriMark :=
(PriOutcomes.GetProperty('Level'+levelidx.ToString ) as TPRIMark);
except
PriMark := (PriOutcomes.GetProperty('LevelNA') as TPRIMark);
end;
if (Assigned(PriMark)) then
if (hid.Value <> '0') and (hid.Value <> '') then
PriMark.FChecked := True
else
PriMark.FChecked := False;
End;
end;


Any advice on this one is greatly appreciated.
Cheers
Jeremy
 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
To all Gurus: How can I edit/update a DataGrid in a DataGrid (nested DataGrid)? Possible? Andreas Klemt ASP .Net Datagrid Control 0 10-08-2003 01:19 AM
Needed: Advice on Film Scanning, Or Website Which Has This Advice Larry R Harrison Jr Digital Photography 0 09-06-2003 01:00 AM
Re: Celebrity advice (was: Advice to a Junior in High School?) Peter Hansen Python 23 09-05-2003 03:11 PM
OT: Celebrity advice (was: Advice to a Junior in High School?) Gerrit Holl Python 16 08-29-2003 06:10 AM
Re: Celebrity advice (was: Advice to a Junior in High School?) Asun Friere Python 1 08-27-2003 12:01 PM



Advertisments