|
dev
newsgroups
|
|||||||||||||||||||||||
|
|||||||||||||||||||||||
Can we filter columns in a dataset ?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. 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. > > > 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 Hi Chak,
Depends on the data consumer as this is a job for UI. Which one are you using? -- Show quoteMiha 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. > 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. >> > > 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 -- Show quoteMiha 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:%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. >>> >> >> > > 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. > >> > > > > > > > |
|||||||||||||||||||||||