Jump to content

gridveiw with fields contains links !

- - - - -

  • Please log in to reply
1 reply to this topic

#1
rahmo

rahmo

    Newbie

  • Members
  • Pip
  • 1 posts
hello everyone
not sure if this the right forum to ask but im having a problem in here
here is the code for my page

------------------------------------------------------
<body>

    <form id="form1" runat="server">

    <div>

        <asp:GridView ID="GridView1" runat="server"  BorderStyle="Double" BackColor="Aqua"  >

        </asp:GridView>

    </div>

    </form>

</body>
--------------------------------------------------------
and here's the c# code to poulate the date in the grid veiw
---------------------------------------------------------
 protected void Page_Load(object sender, EventArgs e)

    {

        string query = "select * from gveiw";

        SqlConnection conn = new SqlConnection("Data Source=RAHMONY-PC\\RAHMO;Initial Catalog=test;Persist Security Info=True;User ID=sa;Password=***");

        SqlDataAdapter ad = new SqlDataAdapter (query,conn);

        DataSet ds = new DataSet();

        ad.Fill(ds, "gveiw");

        GridView1.DataSource = ds;

        GridView1.DataBind();



    }
and the resulted page is this and as u can see file column contains links to files in the server it's suposed to have diffrent links but im doin 1 just for testing , wat i want is to make each field in the file column accessible means i can press this link and it open the file link , any idea ?
Posted Image

thanks in advance :)

Edited by Roger, 15 December 2011 - 06:48 PM.
removed link


#2
lespauled

lespauled

    Programming Professional

  • Members
  • PipPipPipPipPip
  • 231 posts
  • Programming Language:C, C++, C#, JavaScript, PL/SQL, Delphi/Object Pascal, Visual Basic .NET, Pascal, Transact-SQL, Bash
Check out Gridview template fields or Repeater item templates. You can place any kind of controls inside them.




1 user(s) are reading this topic

0 members, 1 guests, 0 anonymous users