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. Gridview control Problem

Gridview control Problem

Scheduled Pinned Locked Moved ASP.NET
cssgraphicsdesignhelp
2 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.
  • A Offline
    A Offline
    amistry_petlad
    wrote on last edited by
    #1

    Hi all! I am creating a grid view control containing data and column coming from two different sources . 1)first two columns in grid control coming from 1 source with all the data like field_name1 and field_name2. 2) second having the 1 column(Table Field) in the table which is display as columns header text in the grid view control combin with the above grid view. Now the problem. All the time the 2) is appear first i want to show him in 2nd priority. 1) shoud be display first. below is the code for that if (chkHealthPlanDP.Checked) { //grdByHealthPlanDP.Visible = true; System.Web.UI.WebControls.GridView DiseaseGrid = new GridView(); DiseaseGrid.DataSource = **REPORT_METRIC_ENTITYMIX.GetData(2);** //data coming from source one DiseaseGrid.DataBind(); DiseaseGrid.Width = 100; DiseaseGrid.Height = 50; DiseaseGrid.GridLines = GridLines.Both; DiseaseGrid.CellPadding = 0; DiseaseGrid.HeaderStyle.BackColor = System.Drawing.Color.Pink; foreach (Master_ref_disease masterDisease in **Master_reference_disease.result()** //source 2) { BoundField c = new BoundField(); c.HeaderText = masterDisease.D_ID; //c.DataField = masterDisease.D_ID; DiseaseGrid.Columns.Add(c); } PlaceHolder1.Controls.Add(DiseaseGrid); DiseaseGrid.DataBind(); }

    N 1 Reply Last reply
    0
    • A amistry_petlad

      Hi all! I am creating a grid view control containing data and column coming from two different sources . 1)first two columns in grid control coming from 1 source with all the data like field_name1 and field_name2. 2) second having the 1 column(Table Field) in the table which is display as columns header text in the grid view control combin with the above grid view. Now the problem. All the time the 2) is appear first i want to show him in 2nd priority. 1) shoud be display first. below is the code for that if (chkHealthPlanDP.Checked) { //grdByHealthPlanDP.Visible = true; System.Web.UI.WebControls.GridView DiseaseGrid = new GridView(); DiseaseGrid.DataSource = **REPORT_METRIC_ENTITYMIX.GetData(2);** //data coming from source one DiseaseGrid.DataBind(); DiseaseGrid.Width = 100; DiseaseGrid.Height = 50; DiseaseGrid.GridLines = GridLines.Both; DiseaseGrid.CellPadding = 0; DiseaseGrid.HeaderStyle.BackColor = System.Drawing.Color.Pink; foreach (Master_ref_disease masterDisease in **Master_reference_disease.result()** //source 2) { BoundField c = new BoundField(); c.HeaderText = masterDisease.D_ID; //c.DataField = masterDisease.D_ID; DiseaseGrid.Columns.Add(c); } PlaceHolder1.Controls.Add(DiseaseGrid); DiseaseGrid.DataBind(); }

      N Offline
      N Offline
      Nishant Singh
      wrote on last edited by
      #2

      Why not take a Child Grid for showing records of dataSource 2

      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