Wrox Programmer Forums
|
.NET Framework 1.x For discussing versions 1.0 and 1.1 of the Microsoft .NET Framework.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the .NET Framework 1.x section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old November 2nd, 2005, 06:42 PM
Authorized User
 
Join Date: Feb 2005
Posts: 10
Thanks: 0
Thanked 0 Times in 0 Posts
Default datagrid help

hi
i need help form all of u. i use datagrid in my asp.net page.i bound datagrid by using dataset.now each value in datagrid is work as hyperlink.when i click this datagrid values which work as hyperlink it redirect to desire page.for example datagrid bound by dataset and 10 values bound to datagrid.
when i click 1 it redirect to 1.aspx page
when i click 2 it redirect to 2.aspx page
when i click 3 it redirect to 3.aspx page
.... so on
like yahoo,hotmail mail box work.each link redirect to other page.
any one help me then plz..



 
Old November 8th, 2005, 02:01 AM
Authorized User
 
Join Date: Aug 2005
Posts: 15
Thanks: 0
Thanked 0 Times in 0 Posts
Default

you can do this by assigning autogeneratecolumns=false to datagrid and as under


<columns>
  <asp:hyperlinkcolumn>"in this tag there are some attributes i dont have .net right now but i know it is there where u have to assign the fieldname&".aspx" there"

u will get it
<columns>

dkautilya
[email protected]
 
Old November 22nd, 2005, 02:06 AM
Registered User
 
Join Date: Nov 2005
Posts: 6
Thanks: 0
Thanked 0 Times in 0 Posts
Default

If you can use a javascript property then it woud be very easy. Use <hyperlink:column> and for each colum assign an attribute like
for (int rowPos = 0; rowPos < dg.Items.Count; rowPos++)
{
for (int colPos = 0; colPos < dg.Items[rowPos].Cells.Count; colPos++)
{
dg.Items[rowPos].Cells[colPos].Attributes["onclick"] = "javascript:window.open('+dg.Items[rowPos].Cells[colPos].Text+'.aspx','displayWindow','toolbar=no,width=40 0,height=400,directories=no,status=no,scrollbars=n o,resize=no,menubar=no');return false;");
}
}

If you want it for a single column then just fix the colPos variable to your desired fixed value. I think it will work if you can handle javascript.Thanks....

Arindam Jha





Similar Threads
Thread Thread Starter Forum Replies Last Post
Custom paging in Datagrid with datagrid page count madhusrp ASP.NET 1.0 and 1.1 Professional 12 June 2nd, 2008 01:15 PM
User COntrol Datagrid inside datagrid rodmcleay ASP.NET 1.0 and 1.1 Professional 3 April 14th, 2007 10:11 AM
Creating DataGrid In Repeater/DataGrid liduwan ASP.NET 1.0 and 1.1 Professional 9 March 6th, 2007 03:31 PM
datagrid ajaidass ADO.NET 2 March 1st, 2007 05:36 PM
Need help regarding datagrid ngsharmila .NET Framework 1.x 1 February 1st, 2006 12:55 AM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.