Your Privacy Matters: We use our own and third-party cookies to improve your experience on our website. By continuing to use the website we understand that you accept their use. Cookie Policy
627
HyperLink column - the new window does not get the focus
posted

Hi,

I'm using a HyperLink column in a webGrid. Clicking the hyperLink opens a new window, but the new opened window does not get the focus.

I did it by:

UltraGridCell CEIDCell = e.Row.Cells.FromKey("ID");

CEIDCell.Column.Type = ColumnType.HyperLink;

CEIDCell.TargetURL = string.Format("@[_blank]ID_MainPage.aspx?ID={0}", CEIDCell.Value);

CEIDCell.AllowEditing = AllowEditing.No;

 

How can I cause the new window get the focus?

 

Thanks

Maya

Intel

Parents
  • 28464
    posted

    I am trying to reproduce this error, unfortunately to no avail. Is there something that I am missing? I am binding to standard NorthWind database and using your syntax in the grid InitializeRow event. I tested both in Firefox and IE and was able to get the new page open and gain office just fine.

    Is it possible that there is something else that is interfering with the focus on the page (e.g. input controls, other control on the page, etc).

    Here is my code:

     <igtbl:UltraWebGrid ID="UltraWebGrid1" runat="server"
            DataSourceID="AccessDataSource1" Height="200px"
            oninitializerow="UltraWebGrid1_InitializeRow" Width="325px">
            <bands>
                <igtbl:UltraGridBand>
                    <Columns>
                        <igtbl:UltraGridColumn BaseColumnName="ProductID" DataType="System.Int32"
                            IsBound="True" Key="ProductID">
                            <Header Caption="ProductID">
                            </Header>
                        </igtbl:UltraGridColumn>
                        <igtbl:UltraGridColumn BaseColumnName="ProductName" IsBound="True"
                            Key="ProductName">
                            <Header Caption="ProductName">
                                <RowLayoutColumnInfo OriginX="1" />
                            </Header>
                            <Footer>
                                <RowLayoutColumnInfo OriginX="1" />
                            </Footer>
                        </igtbl:UltraGridColumn>
                        <igtbl:UltraGridColumn BaseColumnName="SupplierID" DataType="System.Int32"
                            IsBound="True" Key="SupplierID">
                            <Header Caption="SupplierID">
                                <RowLayoutColumnInfo OriginX="2" />
                            </Header>
                            <Footer>
                                <RowLayoutColumnInfo OriginX="2" />
                            </Footer>
                        </igtbl:UltraGridColumn>
                    </Columns>
                    <addnewrow view="NotSet" visible="NotSet">
                    </addnewrow>
                </igtbl:UltraGridBand>
            </bands>
            <displaylayout bordercollapsedefault="Separate" name="UltraWebGrid1"
                rowheightdefault="20px" version="4.00">
                <framestyle borderstyle="Solid" borderwidth="1px" font-names="Verdana"
                    font-size="8pt" height="200px" width="325px">
                </framestyle>
                <pager>
                    <PagerStyle BackColor="LightGray" BorderStyle="Solid" BorderWidth="1px">
                    <borderdetails colorleft="White" colortop="White" />
                    </PagerStyle>
                </pager>
                <editcellstyledefault borderstyle="None" borderwidth="0px">
                </editcellstyledefault>
                <headerstyledefault backcolor="LightGray" borderstyle="Solid">
                    <borderdetails colorleft="White" colortop="White" />
                </headerstyledefault>
                <rowstyledefault backcolor="White" bordercolor="Gray" borderstyle="Solid"
                    borderwidth="1px" font-names="Verdana" font-size="8pt">
                    <padding left="3px" />
                    <borderdetails colorleft="White" colortop="White" />
                </rowstyledefault>
                <addnewbox>
                    <boxstyle backcolor="LightGray" borderstyle="Solid" borderwidth="1px">
                        <borderdetails colorleft="White" colortop="White" />
                    </boxstyle>
                </addnewbox>
                <activationobject bordercolor="" borderwidth="">
                </activationobject>
            </displaylayout>
        </igtbl:UltraWebGrid>
        <asp:AccessDataSource ID="AccessDataSource1" runat="server"
            DataFile="~/App_Data/Nwind.mdb"
            SelectCommand="SELECT [ProductID], [ProductName], [SupplierID] FROM [Alphabetical List of Products]">
        </asp:AccessDataSource>


    protected void UltraWebGrid1_InitializeRow(object sender, Infragistics.WebUI.UltraWebGrid.RowEventArgs e)
        {
            UltraGridCell CEIDCell = e.Row.Cells.FromKey("ProductID");

            CEIDCell.Column.Type = ColumnType.HyperLink;
            CEIDCell.TargetURL = string.Format("@[_blank]default.aspx?ID={0}", CEIDCell.Value);

            CEIDCell.AllowEditing = AllowEditing.No;
        }

Reply Children