Rain
Sat Nov 26 15:18:21 CST 2005
Thanks Paul,
I should mention that I am using VS 2003, and that my data source is a table
in an Access mdb.
I am now studying the article you referred me to below. Hopefully
DataGridTableStyle will provide what I need.
I tried your second suggestion and got: "'System.Windows.Forms.DataGrid'
does not contain a definition for 'Columns'". Is that property available in
2003? Is it available for web pages only?
As to the Property Builder, I can't find it. Is that available for Windows
Forms, or is it just a web page thing?
Phil
"Paul Gielens" <pgielens@gmail.com.nospam> wrote in message
news:ezZxJ4m8FHA.808@TK2MSFTNGP09.phx.gbl...
>
> One option is to add a TableStyle to your datagrid in which you can
> configure the visible column and column headers. See this article
> Customizing the Windows Forms DataGrid
>
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/dnwinforms/html/wnf_custdatagrid.asp.
>
> For a more dynamic behavior you can set the Visible property during
> runtime grid.Columns[index].Visible = false;
>
> Another option is to disable the "Create Columns automatically at runtime"
> via the Property Builder by right clicking the datagrid.
>
> ###
> Best regards,
> Paul Gielens
>
> Visit my blog @
http://weblogs.asp.net/pgielens/
>
> "Rain County" <raincounty-at-hotmail> wrote in message
> news:u9GvDji8FHA.472@TK2MSFTNGP15.phx.gbl...
>>
>> I wish to display, in a datagrid, only six columns of a table containing
>> about twenty. I've created a data adapter which selects only the desired
>> columns. I created a dataset and a dataview, and specified the dataview
>> as the data source for my datagrid.
>>
>> The datagrid displays the 6 desired columns, in the sequence that I
>> selected them, followed by the remaning 14. I read someplace that this
>> is the default behavior.
>>
>> Two questions:
>>
>> (1) How do I hide the unwanted 14 coulumns?
>> (2) How can I change the column headings to something other than the
>> column name of the underlying table?
>>
>> Thanks, Phil
>>
>> raincounty<*>hotmail.com -- replace the <*> with you know what
>>
>>
>
>
>