asp.net - Grid view column arragement -


After text

I have a problem showing the data in the gridview in different columns but the data is displayed in a single column.

Design

  & lt; ASP: GridView id = "GridView1" runat = "server" class = "international_news" AutoGenerateColumns = "false" DataKeyNames = "news_id" onrowcommand = "GridView1_RowCommand" & gt; & Lt; Columns & gt; & Lt; Asp: boundfield datafield = "news_id" /> & Lt; ASP: BoundfieldDocumentfield = "News_title" /> & Lt; ASP: TemplateField & gt; & Lt; ItemTemplate & gt; & Lt; ASP: LinkButton id = "LinkButton1" runat = "server" commandname = "Readmore" CommandArgument = '& lt;% # Eval ("news_id")% & gt; & Gt; Read more & lt; / Asp: LinkButton & gt; & Lt; / ItemTemplate & gt; & Lt; / ASP: TemplateField & gt; & Lt; / Column & gt; & Lt; / ASP: GridView & gt;  

Back

code
  if (! This.IsPostBack) {dt.Columns.AddRange (New DataColumn [2] {New DataColumn ("news_id", Typef (string), new docile column ("news-title", typef (string))); While (Dr. Reid ()) {if (dr [1]. Toaster ()! = "Yes") {dt.Rows.Add (dr [0]. ToString ()); Dt.Rows.Add (Dr. [1] .toString ()); GridView1.DataSource = dt; GridView1.DataBind (); }}  

I'm not positive which you are walking properly - do you say Are Gridview Controls Showing Only One Column When Displaying On The HTML Page? If so, can you tell us what is being shown in the column?

In addition, I see the problem "behind your code" - you should not set and force gridwitch within your time. . Take it after the loop, and see if you do not make a difference in what you are looking for


OK, you are looking at two columns at this point - (what i do Can not tell) no one At this point, the worrying linkbutton will not appear, right? Can you see any HTML on the page, if you see the page source, this can be a link button? If so, you can post what you see?

Also, let us know if anything changes when you break the gridview while loop.


It looks like now you are looking at all three columns at this point, based on your most recent comment. What are the next issues? Do you expect to look a bit different? Can you tell us what are you looking at compared to what you are actually seeing?


Comments