I can't see the source because it is in a modal dialog window, but I'm doing
nothing other than the normal. Keep in mind this works fine in a normal
window, just doesn't work in a modal window.
<asp:datagrid
id="dgDataGrid "
runat="server"
CssClass="dbgri d"
BorderColor="#3 366CC"
BorderWidth="1p x"
BackColor="Whit e"
BorderStyle="No ne"
AllowPaging="Fa lse"
Height="86px"
Width="580"
AutoGenerateCol umns="False"
AllowSorting="T rue"
DataKeyField="I D">
<SelectedItemSt yle
Font-Bold="True"
ForeColor="#CCF F99"
BackColor="#009 999">
</SelectedItemSty le>
<ItemStyle
ForeColor="#003 399"
BackColor="Whit e">
</ItemStyle>
<HeaderStyle
Font-Bold="True"
ForeColor="#CCC CFF"
BackColor="#003 399">
</HeaderStyle>
<FooterStyle
ForeColor="#003 399"
BackColor="#99C CCC">
</FooterStyle>
<Columns>
<asp:buttonColu mn
ButtonType="Lin kButton"
HeaderText="Lnk "
Visible="False"
HeaderStyle-Width="10%">
</asp:buttonColum n>
<asp:BoundColum n
DataField="Type "
SortExpression= "Type"
ReadOnly="True"
HeaderText="Typ e">
</asp:BoundColumn >
<asp:BoundColum n
DataField="Desc ription"
SortExpression= "Descriptio n"
ReadOnly="True"
HeaderText="Des cription">
</asp:BoundColumn >
</Columns>
</asp:datagrid>
In code behind I have the following sub
Sub dgDataGridSortC ommand(ByVal source As System.Object, ByVal e As
System.Web.UI.W ebControls.Data GridSortCommand EventArgs) Handles
dgDataGrid.Sort Command
viewstate.Add(" sortfield", e.SortExpressio n)
If viewstate("sort direction") Is Nothing Then
viewstate.Add(" sortdirection", "ASC")
Else
If viewstate("sort direction").ToS tring = "ASC" Then
viewstate("sort direction") = "DESC"
ElseIf viewstate("sort direction").ToS tring = "DESC" Then
viewstate("sort direction") = "ASC"
End If
End If
GridBind(e.Sort Expression)
dgDataGrid.Sele ctedIndex = -1
End Sub
"George Ter-Saakov" <no****@hotmail .com> wrote in message
news:%2******** *******@TK2MSFT NGP11.phx.gbl.. .
Check that link does not have
target="somethi ng"
George.
"Raymond Lewallen" <Ra************ ******@nospam.f aa.gov> wrote in message
news:%2******** ********@TK2MSF TNGP10.phx.gbl. .. I have a modal dialog displaying a datagrid control. Click on the
column header to sort the datagrid opens a new window with the following in the
location:
javascript:__do PostBack('dgDat aGrid$_ctl1$_ct l1','')
instead of actually posting back to the modal dialog and sorting the
datagrid. ItemDataBound, ItemCommand events both work fine, only the
SortCommand is producing this unwanted behavior.
Looking for a cause and solution please.
Thank you,
Raymond Lewallen