grid with new link using C#

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • yogarajan
    New Member
    • Apr 2007
    • 115

    grid with new link using C#

    Hi

    i have one doubt abt datagrid (using c#). pls help me

    here is my code

    //** code start here**

    Page_Load event:

    DataSet ds = BuildDataSet();
    DataGrid1.DataS ource = ds;
    DataGrid1.DataB ind();

    private DataSet BuildDataSet(){ DataSet ret = new DataSet(); DataTable dt =
    new DataTable(); DataRow dr = null; // Define table column names and datatypes DataColumn dc =
    new DataColumn("ID" ,Type.GetType(" System.Int32")) ; dt.Columns.Add( dc); dc = new DataColumn("Nam e",Type.GetType ("System.String "));
    dt.Columns.Add( dc); dc = new DataColumn("Dat e",Type.GetType ("System.DateTi me")); dt.Columns.Add( dc); // Fill the table with sample data
    for(int i = 1;i < = 10;i++) { dr = dt.NewRow(); dr["ID"] = i; dr["Name"] = "John Smith";
    dr["Date"] = DateTime.Now.Ad dSeconds(i * 10); dt.Rows.Add(dr) ; } // Return the dataset to the caller ret.Tables.Add( dt);
    return ret;}
    //**** code end here**
    here i have add one more column with link . how can i add?

    pls help me. pls send code immd
    am waiting for ur reply
    i want to be utput looks like this

    ID Name Date URL
    1 John Smith 1/1/2007 Hyper Link

    2 John Smith 2/2/2007 Hyper Link
  • yogarajan
    New Member
    • Apr 2007
    • 115

    #2
    grid with new link using C#

    Hi Mercie

    i have one doubt abt datagrid (using c#). pls help me

    here is my code

    //** code start here**

    Page_Load event:

    DataSet ds = BuildDataSet();
    DataGrid1.DataS ource = ds;
    DataGrid1.DataB ind();

    private DataSet BuildDataSet(){ DataSet ret = new DataSet(); DataTable dt =
    new DataTable(); DataRow dr = null; // Define table column names and datatypes DataColumn dc =
    new DataColumn("ID" ,Type.GetType(" System.Int32")) ; dt.Columns.Add( dc); dc = new DataColumn("Nam e",Type.GetType ("System.String "));
    dt.Columns.Add( dc); dc = new DataColumn("Dat e",Type.GetType ("System.DateTi me")); dt.Columns.Add( dc); // Fill the table with sample data
    for(int i = 1;i < = 10;i++) { dr = dt.NewRow(); dr["ID"] = i; dr["Name"] = "John Smith";
    dr["Date"] = DateTime.Now.Ad dSeconds(i * 10); dt.Rows.Add(dr) ; } // Return the dataset to the caller ret.Tables.Add( dt);
    return ret;}
    //**** code end here**
    here i have add one more column with link . how can i add?

    pls help me. pls send code immd
    am waiting for ur reply
    i want to be utput looks like this

    ID Name Date URL
    1 John Smith 1/1/2007 Hyper Link

    2 John Smith 2/2/2007 Hyper Link

    Comment

    • yogarajan
      New Member
      • Apr 2007
      • 115

      #3
      grid with new link using C#

      Hi
      i have one doubt abt datagrid (using c#). pls help me

      here is my code

      //** code start here**

      Page_Load event:

      DataSet ds = BuildDataSet();
      DataGrid1.DataS ource = ds;
      DataGrid1.DataB ind();

      private DataSet BuildDataSet(){ DataSet ret = new DataSet(); DataTable dt =
      new DataTable(); DataRow dr = null; // Define table column names and datatypes DataColumn dc =
      new DataColumn("ID" ,Type.GetType(" System.Int32")) ; dt.Columns.Add( dc); dc = new DataColumn("Nam e",Type.GetType ("System.String "));
      dt.Columns.Add( dc); dc = new DataColumn("Dat e",Type.GetType ("System.DateTi me")); dt.Columns.Add( dc); // Fill the table with sample data
      for(int i = 1;i < = 10;i++) { dr = dt.NewRow(); dr["ID"] = i; dr["Name"] = "John Smith";
      dr["Date"] = DateTime.Now.Ad dSeconds(i * 10); dt.Rows.Add(dr) ; } // Return the dataset to the caller ret.Tables.Add( dt);
      return ret;}
      //**** code end here**
      here i have add one more column with link . how can i add?

      pls help me. pls send code immd
      am waiting for ur reply
      i want to be utput looks like this

      ID Name Date URL
      1 John Smith 1/1/2007 Hyper Link

      2 John Smith 2/2/2007 Hyper Link

      Comment

      • Motoma
        Recognized Expert Specialist
        • Jan 2007
        • 3236

        #4
        Please do not double (triple) post!

        Comment

        • nmsreddi
          Contributor
          • Jul 2006
          • 366

          #5
          Hello

          If you want to add some special columns like button or link in datagrid you have to use template column for that,you can edit that template column and you can place any control as for your need,

          try it out....

          Comment

          • yogarajan
            New Member
            • Apr 2007
            • 115

            #6
            how ?

            pls give me some samples.

            i am add link colum through programmaticall y

            pls do it needful

            Comment

            • yogarajan
              New Member
              • Apr 2007
              • 115

              #7
              Sir
              please help me
              please give me some samples
              it is very urgent

              Comment

              Working...