Home All Groups Group Topic Archive Search About

Can we filter columns in a dataset ?

Author
13 Jan 2006 10:07 AM
Chak
Just as we use RowFilter, to choose a subset of rows , i wish to get s
subset of the columns. The workaround i could think of was to read the
DataTable again with only required columns eg - SELECT COL1 FROM DT1 where
DT1 is the memory datatable.

1) Is it possible to apply a SELECT on a DataTable ?

2) How would one pick only the required columns after populating the dataset
?

Regards.

Author
13 Jan 2006 10:39 AM
serge calderara
Use the DataView object

Show quote
"Chak" wrote:

> Just as we use RowFilter, to choose a subset of rows , i wish to get s
> subset of the columns. The workaround i could think of was to read the
> DataTable again with only required columns eg - SELECT COL1 FROM DT1 where
> DT1 is the memory datatable.
>
> 1) Is it possible to apply a SELECT on a DataTable ?
>
> 2) How would one pick only the required columns after populating the dataset
> ?
>
> Regards.
>
>
>
Author
13 Jan 2006 10:46 AM
Cor Ligthert [MVP]
Chak,

For Net 1.x you can use the styles from a datagrid

For Net 2.0 you can beside that use the overloaded version from the
DataView.ToTable to create a seperated datatable.

I hope this helps,

Cor
Author
13 Jan 2006 3:52 PM
Miha Markic [MVP C#]
Hi Chak,

Depends on the data consumer as this is a job for UI.
Which one are you using?

--
Miha Markic [MVP C#]
RightHand .NET consulting & development www.rthand.com
Blog: http://cs.rthand.com/blogs/blog_with_righthand/

Show quote
"Chak" <r_chakravar***@hotmail.com> wrote in message
news:edVBxkCGGHA.644@TK2MSFTNGP09.phx.gbl...
> Just as we use RowFilter, to choose a subset of rows , i wish to get s
> subset of the columns. The workaround i could think of was to read the
> DataTable again with only required columns eg - SELECT COL1 FROM DT1 where
> DT1 is the memory datatable.
>
> 1) Is it possible to apply a SELECT on a DataTable ?
>
> 2) How would one pick only the required columns after populating the
> dataset ?
>
> Regards.
>
Author
13 Jan 2006 6:11 PM
Chak
Thanks.  Am using the Windows forms datagrid in 1.1

Regards,

Chak.


Show quote
"Miha Markic [MVP C#]" <miha at rthand com> wrote in message
news:%23bvoVlFGGHA.3944@tk2msftngp13.phx.gbl...
> Hi Chak,
>
> Depends on the data consumer as this is a job for UI.
> Which one are you using?
>
> --
> Miha Markic [MVP C#]
> RightHand .NET consulting & development www.rthand.com
> Blog: http://cs.rthand.com/blogs/blog_with_righthand/
>
> "Chak" <r_chakravar***@hotmail.com> wrote in message
> news:edVBxkCGGHA.644@TK2MSFTNGP09.phx.gbl...
>> Just as we use RowFilter, to choose a subset of rows , i wish to get s
>> subset of the columns. The workaround i could think of was to read the
>> DataTable again with only required columns eg - SELECT COL1 FROM DT1
>> where DT1 is the memory datatable.
>>
>> 1) Is it possible to apply a SELECT on a DataTable ?
>>
>> 2) How would one pick only the required columns after populating the
>> dataset ?
>>
>> Regards.
>>
>
>
Author
14 Jan 2006 8:25 AM
Miha Markic [MVP C#]
I never use DataGrid (always a third party grid) as DataGrid is very limited
control.
Anyway, you might read this thread:
http://groups.google.com/group/microsoft.public.dotnet.languages.csharp/browse_frm/thread/8256a795d6abc5b4/e8555f595f3bfd2e?lnk=st&q=hide+datagrid+columns+group%3A*dotnet*&rnum=1&hl=sl#e8555f595f3bfd2e

--
Miha Markic [MVP C#]
RightHand .NET consulting & development www.rthand.com
Blog: http://cs.rthand.com/blogs/blog_with_righthand/

Show quote
"Chak" <r_chakravar***@hotmail.com> wrote in message
news:%23WUkWzGGGHA.3952@TK2MSFTNGP10.phx.gbl...
> Thanks.  Am using the Windows forms datagrid in 1.1
>
> Regards,
>
> Chak.
>
>
> "Miha Markic [MVP C#]" <miha at rthand com> wrote in message
> news:%23bvoVlFGGHA.3944@tk2msftngp13.phx.gbl...
>> Hi Chak,
>>
>> Depends on the data consumer as this is a job for UI.
>> Which one are you using?
>>
>> --
>> Miha Markic [MVP C#]
>> RightHand .NET consulting & development www.rthand.com
>> Blog: http://cs.rthand.com/blogs/blog_with_righthand/
>>
>> "Chak" <r_chakravar***@hotmail.com> wrote in message
>> news:edVBxkCGGHA.644@TK2MSFTNGP09.phx.gbl...
>>> Just as we use RowFilter, to choose a subset of rows , i wish to get s
>>> subset of the columns. The workaround i could think of was to read the
>>> DataTable again with only required columns eg - SELECT COL1 FROM DT1
>>> where DT1 is the memory datatable.
>>>
>>> 1) Is it possible to apply a SELECT on a DataTable ?
>>>
>>> 2) How would one pick only the required columns after populating the
>>> dataset ?
>>>
>>> Regards.
>>>
>>
>>
>
>
Author
16 Jan 2006 12:36 PM
serge calderara
With the datagrid you can filter the column to show by defined Column mapping
Then you mapp only columns you need to show

Show quote
"Chak" wrote:

> Thanks.  Am using the Windows forms datagrid in 1.1
>
> Regards,
>
> Chak.
>
>
> "Miha Markic [MVP C#]" <miha at rthand com> wrote in message
> news:%23bvoVlFGGHA.3944@tk2msftngp13.phx.gbl...
> > Hi Chak,
> >
> > Depends on the data consumer as this is a job for UI.
> > Which one are you using?
> >
> > --
> > Miha Markic [MVP C#]
> > RightHand .NET consulting & development www.rthand.com
> > Blog: http://cs.rthand.com/blogs/blog_with_righthand/
> >
> > "Chak" <r_chakravar***@hotmail.com> wrote in message
> > news:edVBxkCGGHA.644@TK2MSFTNGP09.phx.gbl...
> >> Just as we use RowFilter, to choose a subset of rows , i wish to get s
> >> subset of the columns. The workaround i could think of was to read the
> >> DataTable again with only required columns eg - SELECT COL1 FROM DT1
> >> where DT1 is the memory datatable.
> >>
> >> 1) Is it possible to apply a SELECT on a DataTable ?
> >>
> >> 2) How would one pick only the required columns after populating the
> >> dataset ?
> >>
> >> Regards.
> >>
> >
> >
>
>
>

AddThis Social Bookmark Button