Hi, I'm trying to display a DataSet data by using a GridView control on Visual Studio 2005 professional. I'm displaying the DataSet directly, without using the DataSource object. I can display selected columns from my DataSet, but I need to display a grid column wich is the result of manipulating some DataSet columns. Obviously I can make the DataSet's table to include the needed column precalculated and filled. But it means to couple the dataset to the grid needs and I'd prefer to mantain the DataSet independent of the presentation layer. How can I do that? Any hint is welcomed Thanks in advance Sammy
Why don't you make a template column and fill it in the RowDataBound event? -- Eliyahu Goldin, Software Developer Microsoft MVP [ASP.NET] http://msmvps.com/blogs/egoldin http://usableasp.net "SammyBar" wrote in message news:uEeRrzA7IHA.616@TK2MSFTNGP02.phx.gbl... > Hi, > > I'm trying to display a DataSet data by using a GridView control on Visual > Studio 2005 professional. I'm displaying the DataSet directly, without > using the DataSource object. I can display selected columns from my > DataSet, but I need to display a grid column wich is the result of > manipulating some DataSet columns. > Obviously I can make the DataSet's table to include the needed column > precalculated and filled. But it means to couple the dataset to the grid > needs and I'd prefer to mantain the DataSet independent of the > presentation layer. > How can I do that? > > Any hint is welcomed > Thanks in advance > Sammy > >
On 22 Jul, 16:09, "SammyBar" wrote: > Hi, > > I'm trying to display a DataSet data by using a GridView control on Visual > Studio 2005 professional. I'm displaying the DataSet directly, without using > the DataSource object. I can display selected columns from my DataSet, but I > need to display a grid column wich is the result of manipulating some > DataSet columns. > Obviously I can make the DataSet's table to include the needed column > precalculated and filled. But it means to couple the dataset to the grid > needs and I'd prefer to mantain the DataSet independent of the presentation > layer. > How can I do that? > > Any hint is welcomed > Thanks in advance > Sammy With templated columns you can bind data using an expression that does the computation. For example: <asp:Label ID="IncPriceLabel" runat="server" Text = '<%# (double)Eval("price") * 1.175 %>' /> HTH