472,955 Members | 2,610 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 472,955 software developers and data experts.

Click on sort link on a datagrid opens new window

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:__doPostBack('dgDataGrid$_ctl1$_ctl1',' ')

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
Nov 18 '05 #1
3 2087
Check that link does not have
target="something"

George.

"Raymond Lewallen" <Ra******************@nospam.faa.gov> wrote in message
news:%2****************@TK2MSFTNGP10.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:__doPostBack('dgDataGrid$_ctl1$_ctl1',' ')

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

Nov 18 '05 #2
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="dbgrid"
BorderColor="#3366CC"
BorderWidth="1px"
BackColor="White"
BorderStyle="None"
AllowPaging="False"
Height="86px"
Width="580"
AutoGenerateColumns="False"
AllowSorting="True"
DataKeyField="ID">

<SelectedItemStyle
Font-Bold="True"
ForeColor="#CCFF99"
BackColor="#009999">
</SelectedItemStyle>

<ItemStyle
ForeColor="#003399"
BackColor="White">
</ItemStyle>

<HeaderStyle
Font-Bold="True"
ForeColor="#CCCCFF"
BackColor="#003399">
</HeaderStyle>

<FooterStyle
ForeColor="#003399"
BackColor="#99CCCC">
</FooterStyle>

<Columns>
<asp:buttonColumn
ButtonType="LinkButton"
HeaderText="Lnk"
Visible="False"
HeaderStyle-Width="10%">
</asp:buttonColumn>

<asp:BoundColumn
DataField="Type"
SortExpression="Type"
ReadOnly="True"
HeaderText="Type">
</asp:BoundColumn>

<asp:BoundColumn
DataField="Description"
SortExpression="Description"
ReadOnly="True"
HeaderText="Description">
</asp:BoundColumn>
</Columns>

</asp:datagrid>

In code behind I have the following sub

Sub dgDataGridSortCommand(ByVal source As System.Object, ByVal e As
System.Web.UI.WebControls.DataGridSortCommandEvent Args) Handles
dgDataGrid.SortCommand
viewstate.Add("sortfield", e.SortExpression)
If viewstate("sortdirection") Is Nothing Then
viewstate.Add("sortdirection", "ASC")
Else
If viewstate("sortdirection").ToString = "ASC" Then
viewstate("sortdirection") = "DESC"
ElseIf viewstate("sortdirection").ToString = "DESC" Then
viewstate("sortdirection") = "ASC"
End If

End If

GridBind(e.SortExpression)
dgDataGrid.SelectedIndex = -1
End Sub

"George Ter-Saakov" <no****@hotmail.com> wrote in message
news:%2***************@TK2MSFTNGP11.phx.gbl...
Check that link does not have
target="something"

George.

"Raymond Lewallen" <Ra******************@nospam.faa.gov> wrote in message
news:%2****************@TK2MSFTNGP10.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:__doPostBack('dgDataGrid$_ctl1$_ctl1',' ')

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


Nov 18 '05 #3
Unfortunately never worked with modal windows.
Anyway your datagrid looks good.
Check the form tag maybe "target" slipped in there.
George.

"Raymond Lewallen" <Ra******************@nospam.faa.gov> wrote in message
news:u2**************@TK2MSFTNGP10.phx.gbl...
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="dbgrid"
BorderColor="#3366CC"
BorderWidth="1px"
BackColor="White"
BorderStyle="None"
AllowPaging="False"
Height="86px"
Width="580"
AutoGenerateColumns="False"
AllowSorting="True"
DataKeyField="ID">

<SelectedItemStyle
Font-Bold="True"
ForeColor="#CCFF99"
BackColor="#009999">
</SelectedItemStyle>

<ItemStyle
ForeColor="#003399"
BackColor="White">
</ItemStyle>

<HeaderStyle
Font-Bold="True"
ForeColor="#CCCCFF"
BackColor="#003399">
</HeaderStyle>

<FooterStyle
ForeColor="#003399"
BackColor="#99CCCC">
</FooterStyle>

<Columns>
<asp:buttonColumn
ButtonType="LinkButton"
HeaderText="Lnk"
Visible="False"
HeaderStyle-Width="10%">
</asp:buttonColumn>

<asp:BoundColumn
DataField="Type"
SortExpression="Type"
ReadOnly="True"
HeaderText="Type">
</asp:BoundColumn>

<asp:BoundColumn
DataField="Description"
SortExpression="Description"
ReadOnly="True"
HeaderText="Description">
</asp:BoundColumn>
</Columns>

</asp:datagrid>

In code behind I have the following sub

Sub dgDataGridSortCommand(ByVal source As System.Object, ByVal e As
System.Web.UI.WebControls.DataGridSortCommandEvent Args) Handles
dgDataGrid.SortCommand
viewstate.Add("sortfield", e.SortExpression)
If viewstate("sortdirection") Is Nothing Then
viewstate.Add("sortdirection", "ASC")
Else
If viewstate("sortdirection").ToString = "ASC" Then
viewstate("sortdirection") = "DESC"
ElseIf viewstate("sortdirection").ToString = "DESC" Then
viewstate("sortdirection") = "ASC"
End If

End If

GridBind(e.SortExpression)
dgDataGrid.SelectedIndex = -1
End Sub

"George Ter-Saakov" <no****@hotmail.com> wrote in message
news:%2***************@TK2MSFTNGP11.phx.gbl...
Check that link does not have
target="something"

George.

"Raymond Lewallen" <Ra******************@nospam.faa.gov> wrote in message
news:%2****************@TK2MSFTNGP10.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:__doPostBack('dgDataGrid$_ctl1$_ctl1',' ')

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



Nov 18 '05 #4

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

3
by: JohnEGee | last post by:
Hello, all, and TIA for any help you can offer. I've searched the Internet for answers and have finally come here. I've created a page (several, actually) with a link that opens a pop-up...
4
by: - R | last post by:
Hello all. I'm new to .Net so please help me out. I have a application with several "Threads" running to observe various things. From time to time each thread need to add an log entry, which...
4
by: Steve B. | last post by:
I have a DataGrid on the left and TextBoxes (TB) on the right. The TB's reflect the contents of the grid cells. Sorting of columns (both thru VS and programmatically) work fine except, when the...
2
by: yatharth | last post by:
I am facing a problem ,the situation is like this. I have a home page named "Index.html" ,on which there is login link,when i click on the login link the login popup opens and user enter the...
4
by: Carlo Marchesoni | last post by:
I have a button that opens a new Window (some kind of search-window), which is fired using JavaScript (btnSearch.Attributes=".....";) Now I need to run some code behind code BEFORE this JavaScript...
3
by: Sameer | last post by:
I have a webpage that has a link button. This link button on click opens up a new page. This is what is happening: 1. Load the web page. 2. Click on the link. 3. Refresh the web-page. Result:...
1
by: settyv | last post by:
Hi, I need to open PDF document in new window when i click on linkbutton in datagrid.For that i have written code as below: But the problem with this code is that it opens the new window ,but...
2
by: wpollans | last post by:
Hello, I need to able to write JS that will click on a link with the middle mouse button - so that the link target will open in a new window or tab - using firefox. Or is there a better (more...
0
by: lllomh | last post by:
Define the method first this.state = { buttonBackgroundColor: 'green', isBlinking: false, // A new status is added to identify whether the button is blinking or not } autoStart=()=>{
0
by: Aliciasmith | last post by:
In an age dominated by smartphones, having a mobile app for your business is no longer an option; it's a necessity. Whether you're a startup or an established enterprise, finding the right mobile app...
0
tracyyun
by: tracyyun | last post by:
Hello everyone, I have a question and would like some advice on network connectivity. I have one computer connected to my router via WiFi, but I have two other computers that I want to be able to...
4
NeoPa
by: NeoPa | last post by:
Hello everyone. I find myself stuck trying to find the VBA way to get Access to create a PDF of the currently-selected (and open) object (Form or Report). I know it can be done by selecting :...
1
by: Teri B | last post by:
Hi, I have created a sub-form Roles. In my course form the user selects the roles assigned to the course. 0ne-to-many. One course many roles. Then I created a report based on the Course form and...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 1 Nov 2023 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM) Please note that the UK and Europe revert to winter time on...
3
by: nia12 | last post by:
Hi there, I am very new to Access so apologies if any of this is obvious/not clear. I am creating a data collection tool for health care employees to complete. It consists of a number of...
0
NeoPa
by: NeoPa | last post by:
Introduction For this article I'll be focusing on the Report (clsReport) class. This simply handles making the calling Form invisible until all of the Reports opened by it have been closed, when it...
0
isladogs
by: isladogs | last post by:
The next online meeting of the Access Europe User Group will be on Wednesday 6 Dec 2023 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, Mike...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.