[RESOLVED] datagrid popout with window limits

hi all

I have a datagrid I want the popout window limited ti a certine size with on bars or anything.  I know there is a javescript that works with webcontrols but what do you do in this situation with this type

 

<asp:DataGrid id="MyList" BorderColor="black" GridLines="Vertical" cellpadding="4" cellspacing="0" ShowFooter="true" AutoGenerateColumns="false" runat="server">
    <FooterStyle font-size="Smaller" BackColor="#C0C0FF" font-names="Arial" forecolor="Black"></FooterStyle>
    <HeaderStyle font-size="Smaller" BackColor="#C0C0FF" font-names="Arial" forecolor="Black"></HeaderStyle>
    <ItemStyle font-size="Smaller" BackColor="White" font-names="Arial" forecolor="Black"></ItemStyle>
	<Columns>
        <asp:BoundColumn HeaderText="Contact ID" DataField="ID" />
        <asp:BoundColumn HeaderText="First Name" DataField="first_name" />
        <asp:BoundColumn HeaderText="Last Name" DataField="last_name" />
        <asp:BoundColumn HeaderText="E-mail" DataField="email_address"></asp:BoundColumn>
        <asp:HyperLinkColumn HeaderText="Contact Details" Text="Contact Details" DataNavigateUrlField="ID" DataNavigateUrlFormatString="contact_details.aspx?ContactID={0}"  Target="_blank" />
    </Columns>
    </asp:DataGrid>


 

Well after a little bit I seemed to figure it out

 

<script type="text/javascript">
    function movepic(img_name, img_src) {
        document[img_name].src = img_src;
    }
    function SetTarget() {


        document.forms[0].target = "_blank";


    }
    var URLPOS = 0, NAMEPOS = 1, PROPERTYPOS = 2;


    function OpenWin(props) {
        var lsProperties, myWin, lsURLPrefix;


        if (props.split)
            lsProperties = props.split("|");
        else
            lsProperties = OldBrowserSplit(props, "|");


        if (lsProperties[URLPOS] != null) {
            if (lsProperties[NAMEPOS] == null)
                lsProperties[NAMEPOS] = "";


            if (lsProperties[PROPERTYPOS] == null)
                lsProperties[PROPERTYPOS] = "";




            lsURLPrefix = ""


            if (lsProperties[URLPOS].substring(0, 4) != "http") {


                if (lsProperties[URLPOS].substring(0, 1) != "/")


                    lsURLPrefix = "";




            }


            myWin = window.open(lsURLPrefix + lsProperties[URLPOS], lsProperties[NAMEPOS], lsProperties[PROPERTYPOS]);




        }


    }


    function OldBrowserSplit(OrigStr, tok) {
        var it = new Array();
        var counter = 0, cur = 0, prev = 0;
        var str = OrigStr;


        cur = str.indexOf(tok, prev);
        while (cur != -1) {
            it[counter] = str.substring(prev, cur);
            counter += 1;
            str = str.substring(cur + 1);
            prev = 0;
            cur = str.indexOf(tok);
        }
        it[counter] = str.substring(prev);
        return it;
    }
</script>


<asp:HyperLinkColumn HeaderText="Contact Details" Text="Contact Details" DataNavigateUrlField="ID" DataNavigateUrlFormatString="javascript:OpenWin('contact_details.aspx?ContactID={0}||height=250,width=300,location=no,resizable=no,scrollbars=no,toolbar=no');"/>


 

thoughts on "[RESOLVED] datagrid popout with window limits"

Leave a Reply

Your email address will not be published. Required fields are marked *

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>