Display Data in GridView Asp.Net 2.0
-
Hi, I am Binding a DataTable with a GridView control. This DataTable contains four DataColumn values (all are string type). So, in my GridView each row is displayed as FOUR columns.(ie)One Column for each DataColumn. But i wish to display all the FOUR DataColumn values in a Single Column (Cell) of a Data Row in the GridView. In this, i need to bind all the Four DataColumn values in a Single Cell's four server controls (like Label control,etc.) How can i achieve this?
Regards, Jay
-
Hi, I am Binding a DataTable with a GridView control. This DataTable contains four DataColumn values (all are string type). So, in my GridView each row is displayed as FOUR columns.(ie)One Column for each DataColumn. But i wish to display all the FOUR DataColumn values in a Single Column (Cell) of a Data Row in the GridView. In this, i need to bind all the Four DataColumn values in a Single Cell's four server controls (like Label control,etc.) How can i achieve this?
Regards, Jay
just do that
< asp:GridView ID="gv" runat="server"> < Columns> < asp:TemplateField> <%#DataBinder.Eval(Container,"DataItem.YourFirstColumnName") %> <%#DataBinder.Eval(Container,"DataItem.YourSecondColumnName") %> <%#DataBinder.Eval(Container,"DataItem.YourThirdColumnName") %> <%#DataBinder.Eval(Container,"DataItem.YourForthColumnName") %> < /asp:TemplateField> < /Columns> < /asp:GridView>
-
just do that
< asp:GridView ID="gv" runat="server"> < Columns> < asp:TemplateField> <%#DataBinder.Eval(Container,"DataItem.YourFirstColumnName") %> <%#DataBinder.Eval(Container,"DataItem.YourSecondColumnName") %> <%#DataBinder.Eval(Container,"DataItem.YourThirdColumnName") %> <%#DataBinder.Eval(Container,"DataItem.YourForthColumnName") %> < /asp:TemplateField> < /Columns> < /asp:GridView>
It works fine with me. But my Requirement is that, i wish to Convert each three rows of GridView data into Single row. ie the DataRow in the GridView control is supposed to Display within a Single Cell of GridView. (ie)Each Three row's Datas are need to Display in a Single Row with Three Columns. In this, every column in the GridView having the Same set of Server controls to Display the data from DataTable. Have u understand my requrement? Thank u a lot...
Regards, Jay
-
It works fine with me. But my Requirement is that, i wish to Convert each three rows of GridView data into Single row. ie the DataRow in the GridView control is supposed to Display within a Single Cell of GridView. (ie)Each Three row's Datas are need to Display in a Single Row with Three Columns. In this, every column in the GridView having the Same set of Server controls to Display the data from DataTable. Have u understand my requrement? Thank u a lot...
Regards, Jay
how vital enterprise application are for proactive organizations leveraging collective synergy to think outside the box and formulate their key objectives into a win-win game plan with a quality-driven approach that focuses on empowering key players to drive-up their core competencies and increase expectations with an all-around initiative to drive up the bottom-line. But of course, that's all a "high level" overview of things --thedailywtf 3/21/06
-
how vital enterprise application are for proactive organizations leveraging collective synergy to think outside the box and formulate their key objectives into a win-win game plan with a quality-driven approach that focuses on empowering key players to drive-up their core competencies and increase expectations with an all-around initiative to drive up the bottom-line. But of course, that's all a "high level" overview of things --thedailywtf 3/21/06
Hi Todd, For me, Item property of the DataRowView 'drv' doesnot exist. I dont know the reason, why it is not show me? ( ie drv.Item) Hence i am not familiar using DataRowView Class, now i am in learning process. I ll get back to you soon. Thanks for your interest with me.
Regards, Jay
-
how vital enterprise application are for proactive organizations leveraging collective synergy to think outside the box and formulate their key objectives into a win-win game plan with a quality-driven approach that focuses on empowering key players to drive-up their core competencies and increase expectations with an all-around initiative to drive up the bottom-line. But of course, that's all a "high level" overview of things --thedailywtf 3/21/06