Re: GridView

Tech-Archive recommends: Repair Windows Errors & Optimize Windows Performance



You can do this

Dim cmd As New CommandField
cmd.EditText = "Select"
cmd.ButtonType = ButtonType.Link
cmd.ShowSelectButton = True
grid.Columns.Add(cmd)

or you can do it declaritive
or you can use the wizard

Lot's of choices

But I never link this command button to pop-up window as David is suggesting
--
aaa


"rosoft" wrote:

Hi

<input id="btnChgCurrency" runat="server" type="button" value="Change
Currency" onclick="PopUpWnd()" name="btnChgCurrency" />

But I donät want a button I want the table (GridView) to display a html
link. I tried to enter html text into the database table but that only
showed the source code for the html link in the Grid View such as

<p><a href="www.url.com/tracl.mp3">A Track</a></p>

When I work with PHP I read data from a table and then create a table.
Couldn't I some how make a C# class that handled this. Read data from a
database into some sort of view and then read the view and create html code
that I then write to the page. Having to do all this in a Java Script? Then
I'm better of with a PHP page. I was told that C# can fix these things
easaly.

Is there any C# classes I can use to create backend modules for my homepage
on the server. Some class where I send for example <asp:Table ID="Table1"
runat="server">......</asp:Table>. And then pass Table1 as a parameter to an
object where the object fills the Table with data?

I just don't want to show the informatin in the database as it is since I
use it to build links depending on who's logged into the page.

Lars


"Angel" <rodoopus@xxxxxxxxxxx> skrev i meddelandet
news:740E2606-0B7A-42EA-A059-C7B788AE36CB@xxxxxxxxxxxxxxxx
You are going to need a little Javascript

<script type ="text/javascript">
var win=null;

function NewWindow(mypage,myname,w,h,scroll,pos){


if(pos=="random"){LeftPosition=(screen.width)?Math.floor(Math.random()*(screen.width-w)):100;TopPosition=(screen.height)?Math.floor(Math.random()*((screen.height-h)-75)):100;}


if(pos=="center"){LeftPosition=(screen.width)?(screen.width-w)/2:100;TopPosition=(screen.height)?(screen.height-h)/2:100;}

else if((pos!="center" && pos!="random") ||
pos==null){LeftPosition=0;TopPosition=20}


settings='width='+w+',height='+h+',top='+TopPosition+',left='+LeftPosition+',scrollbars='+scroll+',location=no,directories=no,status=no,menubar=no,toolbar=no,resizable=no';
win=window.open(mypage,myname,settings);}
// Put this in your onclick event

function PopUpWnd()
{
var pg = document.getElementById("id")

NewWindow("CurrencyPage.aspx","abc", 350, 360, "No", "center")
}

</script>


You wire it something like this

<input id="btnChgCurrency" runat="server" type="button" value="Change
Currency" onclick="PopUpWnd()" name="btnChgCurrency" />

--
aaa


"rosoft" wrote:

Hi

I'm using a GridView to list data from a table in my database. On of the
fields is a URL and when I click a row in the GridView I want the page to
automaticly open that link. How do I write code to an event i the
GridView
so that when I click a row the page opens up the new link in another
window?

Lars






.



Relevant Pages

  • Re: GridView
    ... I tried to enter html text into the database table but that only ... // Put this in your onclick event ... I'm using a GridView to list data from a table in my database. ...
    (microsoft.public.dotnet.framework.aspnet)
  • Re: ItemStyle.Width doenst adjust the size of a column?
    ... The problem is with the HTML table itself. ... Eliminate columns from the GridView that you don't need, to reduce the overall table width. ... He joined the company as a sales representative, was promoted to sales manager in January 1992 and to vice president of sales in March 1993. ... I was only able to repeat the problem you described when I included the GridView in a panel and the panel had its width set. ...
    (microsoft.public.dotnet.framework.aspnet.webcontrols)
  • Re: Gridview Updates not writing to database after clicking update
    ... Can you reproduce the behavior through a standard sample database, ... would you try posting a simple test page here so ... Microsoft Online Support ... | Subject: Re: Gridview Updates not writing to database after clicking ...
    (microsoft.public.dotnet.framework.aspnet.webcontrols)
  • Re: I lose data, when I try to save a loaded DataTable on the click of another button in an asp.net
    ... that allows for the upload of an excel sheet into the database. ... I have an upload button and a save button. ... which is bound to a GridView for previewing before ... protected void Upload_Click(object sender, EventArgs e) ...
    (microsoft.public.dotnet.languages.csharp)
  • Re: GridView in a table
    ... Now, AFAIK, it's not "hiding" the GridView, it's being extremely percise--since the designer doesn't have a data source to render columns off of (since we're loading data in code-behind), it assumes that there isn't any data. ... asp:Table generates HTML, but, at least when I go into the designer, I can't manipulate controls inside the TableCell. ... Another here probably has more experience with that control and can provide some insight--it may be behavior by design. ...
    (microsoft.public.dotnet.framework.aspnet)