473,783 Members | 2,418 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

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:__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
Nov 18 '05 #1
3 2126
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

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="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


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.f aa.gov> wrote in message
news:u2******** ******@TK2MSFTN GP10.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="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



Nov 18 '05 #4

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

Similar topics

3
2258
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 window. It's a pop-up window in the sense that it's smaller than the man page and is intended to be viewed and then closed. The problem is that if I include a link on that pop-up window HTML page, when the link is clicked the new page opens IN the...
4
1560
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 is displayed on a form (a datagrid on a form) there is no database, but i created a dataset using the designer. One Entity/Table is called Log and contains the log-entries.
4
2843
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 form/grid first opens up and the grid is immediately sorted the TB don't reflect the sorted data of the First row of the grid. Note: Initially the black grid indicator arrow points to the first row. If the user choses another row and then sorts...
2
2614
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 login information in it. Now when the user click the submit button then new popup window
4
5541
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 runs. I tried to define another Button with an EventHandler associated, and from this (after doing my code) fire 'btnSearch.click()'. But I can't make it work. I tried private void Button1_Click(object sender, System.EventArgs e RestartAll()...
3
10069
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: The webpage gets refreshed and the link buttons onClick event is fired.
1
6100
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 not loading the pdf.Please let me know how can i solve this issue. private void grdTest_ItemCommand(object source, System.Web.UI.WebControls.DataGridCommandEventArgs e)
2
6978
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 reliable) way to have the link open in a new window/tab (using JS)? I have no control over the JS already on the page - this is for a selenium user extension that I'd like to write.
0
10313
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
1
10081
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
9946
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
8968
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
7494
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
6735
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
1
4044
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
3643
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
2875
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.