R
RRB
Hello all,
I have constructed a datatable that is a subset of my dataset. I use a
cached dataview as the datasource for my datagrid.
For performance reasons, I have disabled viewstate on my datagrid and
thus I must perform a databind on postback prior to additional
processing.
Where I've run into a problem is with sorting. I am supporting sortable
columns by button controls in the column header. The intended flow is:
- When a header button is clicked, a postback occurs, I bind the
datagrid first, to enable ASP.Net to invoke my event handler.
- the event handler executes some logic to determine the new sort column
and direction, and sets the sort property on the cached dataview.
- finally, the method responsible for rebinding the datagrid is called.
What I have observed from my debugging is that whatever the value of the
sort property on my dataview prior to my INITIAL databind upon postback,
will be the sort order reflected in the datagrid upon response to the
user. In other words, my SECOND databind is ignored.
If I repeat the cycle by clicking yet another column (or the same
column), I will see in the resulting datagrid the sort order I should
have seen in the PRIOR response. So, now the displayed sort is now
always one behind!
My only theory is that maybe datagrid is not detecting that I've changed
the sort order and is failing to reorder the rows. But to be honest,
I'm at wit's end and I'm hoping someone can help me figure out what I
may be doing wrong.
======================
blackbox testing prerequisites:
1 white box
1 black marker
1 idiot
I have constructed a datatable that is a subset of my dataset. I use a
cached dataview as the datasource for my datagrid.
For performance reasons, I have disabled viewstate on my datagrid and
thus I must perform a databind on postback prior to additional
processing.
Where I've run into a problem is with sorting. I am supporting sortable
columns by button controls in the column header. The intended flow is:
- When a header button is clicked, a postback occurs, I bind the
datagrid first, to enable ASP.Net to invoke my event handler.
- the event handler executes some logic to determine the new sort column
and direction, and sets the sort property on the cached dataview.
- finally, the method responsible for rebinding the datagrid is called.
What I have observed from my debugging is that whatever the value of the
sort property on my dataview prior to my INITIAL databind upon postback,
will be the sort order reflected in the datagrid upon response to the
user. In other words, my SECOND databind is ignored.
If I repeat the cycle by clicking yet another column (or the same
column), I will see in the resulting datagrid the sort order I should
have seen in the PRIOR response. So, now the displayed sort is now
always one behind!
My only theory is that maybe datagrid is not detecting that I've changed
the sort order and is failing to reorder the rows. But to be honest,
I'm at wit's end and I'm hoping someone can help me figure out what I
may be doing wrong.
======================
blackbox testing prerequisites:
1 white box
1 black marker
1 idiot