Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. Web Development
  3. ASP.NET
  4. LinkButton in DataGrid

LinkButton in DataGrid

Scheduled Pinned Locked Moved ASP.NET
databasesysadminquestion
3 Posts 2 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • V Offline
    V Offline
    VanithaVasu
    wrote on last edited by
    #1

    I have a datagrid already binded with dataset. And i have two columns the first column contains Image and the second column contains a table . In the table i have two rows. And in particular column say 2nd row 2nd column i have to create number of linkbutton which i get from another query. This is way i have done my codes. But i am not able to display Total number of linkbuttons . public string Call_Author(string IsbnID) { string AutnorName=""; DataSet ds; ds = objAddDL.Call_Author(IsbnID); string allname="", AuName=""; foreach (DataRow dr in ds.Tables[0].Rows) {AuName = dr[0].ToString(); } string tempAu = Server.UrlEncode(AuName); return "" + AuName + ""; }

    VanithaVasu

    N 1 Reply Last reply
    0
    • V VanithaVasu

      I have a datagrid already binded with dataset. And i have two columns the first column contains Image and the second column contains a table . In the table i have two rows. And in particular column say 2nd row 2nd column i have to create number of linkbutton which i get from another query. This is way i have done my codes. But i am not able to display Total number of linkbuttons . public string Call_Author(string IsbnID) { string AutnorName=""; DataSet ds; ds = objAddDL.Call_Author(IsbnID); string allname="", AuName=""; foreach (DataRow dr in ds.Tables[0].Rows) {AuName = dr[0].ToString(); } string tempAu = Server.UrlEncode(AuName); return "" + AuName + ""; }

      VanithaVasu

      N Offline
      N Offline
      N a v a n e e t h
      wrote on last edited by
      #2

      Are you able to assign required number of link button to the correct cell ? The code which you supplied doesn't make any sense to me.

      All C# applications should call Application.Quit(); in the beginning to avoid any .NET problems.- Unclyclopedia My Website | Ask smart questions

      V 1 Reply Last reply
      0
      • N N a v a n e e t h

        Are you able to assign required number of link button to the correct cell ? The code which you supplied doesn't make any sense to me.

        All C# applications should call Application.Quit(); in the beginning to avoid any .NET problems.- Unclyclopedia My Website | Ask smart questions

        V Offline
        V Offline
        VanithaVasu
        wrote on last edited by
        #3

        Ya , i got it. But can u tell me is there any other Simple way . And here is my code which worked out. But if this method , i implemented it make be coding conjusted when i have to do some operations on selection of the particular linkbutton. HTML -------- ]]>'> CodeBehind ----------- public string Call_Author(string IsbnID) { ArrayList AuthorCount = new ArrayList(); DataSet ds; ds = objAddDL.Call_Author(IsbnID); // Select query to fetch all author names where IsbnId="someruntimevalue"; string AuthorName=""; foreach (DataRow dr in ds.Tables[0].Rows) { AuthorName = dr[0].ToString(); AuthorCount.Add(AuthorName); } string retval=""; int ACount = AuthorCount.Count; if (ACount == 1) { retval = "" + AuthorCount[0].ToString() + ""; AuthorCount.Clear(); } if (ACount == 2) { retval = "" + AuthorCount[0].ToString() + "" + " , "; retval += "" + AuthorCount[1].ToString() + ""; AuthorCount.Clear(); } if (ACount == 3) { retval = "" + AuthorCount[0].ToString() + "" + " , "; retval += "" + AuthorCount[1].ToString() + "" + " , "; retval += "" + AuthorCount[2].ToString() + ""; AuthorCount.Clear(); } return retval;

        VanithaVasu

        1 Reply Last reply
        0
        Reply
        • Reply as topic
        Log in to reply
        • Oldest to Newest
        • Newest to Oldest
        • Most Votes


        • Login

        • Don't have an account? Register

        • Login or register to search.
        • First post
          Last post
        0
        • Categories
        • Recent
        • Tags
        • Popular
        • World
        • Users
        • Groups