Ask a Question related to ASP.NET Data Grid Control, Design and Development.
-
et #1
Pivot a datagrid?
I seem to remember seeing an article on how to reverse the data in a grid,
so that each record creates a column rather than a row? Does anyone know
how to do this? Thanks for your help.
et Guest
-
Set pivot point of a brush
Is there a way to set the brush's pivot point instead of it being automaticaly placed in the center of the shape ? So, if '1' is the shape and... -
Asp.net reports in the pivot table
Hello, we r making a three tier application in which front end is Asp.net. In application we r supposed to show some reports. previously we were... -
Pivot Table View Problem
I have the following problem: When a computer with W2000 was upgraded to WXP an Access XP form using Pivot Table View stopped working. Most of... -
Pivot Tables
recently got a new computer with office xp, old computer had office xp, pivottables on old system worked great. on the new system I only get body... -
Monitor Pivot software for Mac OS 9.2
Is there *any* software available to provide pivoting between portrait and landscape mode using Mac OS 9.2?? ViewSonic sold me a beautiful 21"... -
Elton Wang #2
Re: Pivot a datagrid?
Once rendering to cliend-side, a datagrid actually is html table. Hence if
you just want to show data in a grid, you can manually create html table
based on your data source, in a revering row/column arrangement.
Or you can reverse row/column in data source. For example, the data source
is a 8 columns and 5 rows datatable, you create a datatable with 5 columns
then assign data from first datatable to second datatable. After binding
datagrid's data source to the second datatable, it shows data in a reversing
behavior.
HTH
"et" <eagletender2001@yahoo.com> wrote in message
news:O6K4m%234uFHA.740@TK2MSFTNGP10.phx.gbl...>I seem to remember seeing an article on how to reverse the data in a grid,
>so that each record creates a column rather than a row? Does anyone know
>how to do this? Thanks for your help.
>
Elton Wang Guest
-
eagle #3
Re: Pivot a datagrid?
That's an idea, although not sure how to do the second one. You mean item
by item I would have to place into the 2nd table? Could you give me some
code or pseudo code examples?
I also want pagination, hence the reason I am sticking to a grid. Thanks
for you rhelp.
"Elton Wang" <elton_wang@hotmail.com> wrote in message
news:eo2c64FvFHA.3792@TK2MSFTNGP10.phx.gbl...> Once rendering to cliend-side, a datagrid actually is html table. Hence if
> you just want to show data in a grid, you can manually create html table
> based on your data source, in a revering row/column arrangement.
>
>
>
> Or you can reverse row/column in data source. For example, the data source
> is a 8 columns and 5 rows datatable, you create a datatable with 5 columns
> then assign data from first datatable to second datatable. After binding
> datagrid's data source to the second datatable, it shows data in a
> reversing behavior.
>
>
>
> HTH
>
>
>
>
>
> "et" <eagletender2001@yahoo.com> wrote in message
> news:O6K4m%234uFHA.740@TK2MSFTNGP10.phx.gbl...>>>I seem to remember seeing an article on how to reverse the data in a grid,
>>so that each record creates a column rather than a row? Does anyone know
>>how to do this? Thanks for your help.
>>
>
eagle Guest
-
Elton Wang #4
Re: Pivot a datagrid?
Following is code snippet :
DataTable secondTable = new DataTable();
DataColumn col;
for (int I = 0; I < datasource.Rows.Count; I++)
{
col = new DataColumn("Col" + I.ToString(),
Type.GetType("System.String"));
secondTable.Columns.Add(col);
}
DataRow newRow;
for (int I = 0; I < datasource.Columns.Count; I++)
{
newRow = secondTable.NewRow();
for (int J = 0; J< datasource.Rows.Count; J++)
{
newRow[J] = datasource.Rows[J][I].ToString();
}
secondTable.Rows.Add(newRow);
}
HTH
"eagle" <eagletender2001@yahoo.com> wrote in message
news:u8fd5asvFHA.2808@TK2MSFTNGP10.phx.gbl...if> That's an idea, although not sure how to do the second one. You mean item
> by item I would have to place into the 2nd table? Could you give me some
> code or pseudo code examples?
>
> I also want pagination, hence the reason I am sticking to a grid. Thanks
> for you rhelp.
>
>
> "Elton Wang" <elton_wang@hotmail.com> wrote in message
> news:eo2c64FvFHA.3792@TK2MSFTNGP10.phx.gbl...> > Once rendering to cliend-side, a datagrid actually is html table. Hencesource> > you just want to show data in a grid, you can manually create html table
> > based on your data source, in a revering row/column arrangement.
> >
> >
> >
> > Or you can reverse row/column in data source. For example, the datacolumns> > is a 8 columns and 5 rows datatable, you create a datatable with 5grid,> > then assign data from first datatable to second datatable. After binding
> > datagrid's data source to the second datatable, it shows data in a
> > reversing behavior.
> >
> >
> >
> > HTH
> >
> >
> >
> >
> >
> > "et" <eagletender2001@yahoo.com> wrote in message
> > news:O6K4m%234uFHA.740@TK2MSFTNGP10.phx.gbl...> >>I seem to remember seeing an article on how to reverse the data in aknow> >>so that each record creates a column rather than a row? Does anyone>> >> >>how to do this? Thanks for your help.
> >>
> >
>
Elton Wang Guest
-
et #5
Re: Pivot a datagrid?
that works! thanks so much for your help.
"Elton Wang" <elton_wang@hotmail.com> wrote in message
news:%23HYz7ntvFHA.2504@tk2msftngp13.phx.gbl...> Following is code snippet :
>
> DataTable secondTable = new DataTable();
> DataColumn col;
> for (int I = 0; I < datasource.Rows.Count; I++)
> {
> col = new DataColumn("Col" + I.ToString(),
> Type.GetType("System.String"));
> secondTable.Columns.Add(col);
> }
>
> DataRow newRow;
> for (int I = 0; I < datasource.Columns.Count; I++)
> {
> newRow = secondTable.NewRow();
> for (int J = 0; J< datasource.Rows.Count; J++)
> {
> newRow[J] = datasource.Rows[J][I].ToString();
> }
> secondTable.Rows.Add(newRow);
> }
>
> HTH
>
> "eagle" <eagletender2001@yahoo.com> wrote in message
> news:u8fd5asvFHA.2808@TK2MSFTNGP10.phx.gbl...> if>> That's an idea, although not sure how to do the second one. You mean
>> item
>> by item I would have to place into the 2nd table? Could you give me some
>> code or pseudo code examples?
>>
>> I also want pagination, hence the reason I am sticking to a grid. Thanks
>> for you rhelp.
>>
>>
>> "Elton Wang" <elton_wang@hotmail.com> wrote in message
>> news:eo2c64FvFHA.3792@TK2MSFTNGP10.phx.gbl...>> > Once rendering to cliend-side, a datagrid actually is html table. Hence> source>> > you just want to show data in a grid, you can manually create html
>> > table
>> > based on your data source, in a revering row/column arrangement.
>> >
>> >
>> >
>> > Or you can reverse row/column in data source. For example, the data> columns>> > is a 8 columns and 5 rows datatable, you create a datatable with 5> grid,>> > then assign data from first datatable to second datatable. After
>> > binding
>> > datagrid's data source to the second datatable, it shows data in a
>> > reversing behavior.
>> >
>> >
>> >
>> > HTH
>> >
>> >
>> >
>> >
>> >
>> > "et" <eagletender2001@yahoo.com> wrote in message
>> > news:O6K4m%234uFHA.740@TK2MSFTNGP10.phx.gbl...
>> >>I seem to remember seeing an article on how to reverse the data in a> know>> >>so that each record creates a column rather than a row? Does anyone>>>>> >>how to do this? Thanks for your help.
>> >>
>> >
>> >
>>
>
et Guest



Reply With Quote

