Ask a Question related to ASP.NET Data Grid Control, Design and Development.
-
Seli #1
DataGrid Dynamic HeaderText
Hell
How can I change the headerText of an AutoGenerateColumns DataGrid
myDataGrid.DataSource=ds.Tables["Products"].DefaultView
myDataGrid.DataBind()
myDataGrid.Columns[0].HeaderText="MARCEL";
in the third line I get always an exception. myDataGrid.Colums.count Returns 0!
Thank
Seli
Seli Guest
-
setting headertext for a datagrid column
Hey, can someone help me with this? I'm trying to change the headerText for a datagrid column programmatically. I'm not trying to create the... -
Change HeaderText of datagrid after binding
(Type your message here) -------------------------------- From: Sangra Hi, I got a datagrid which I want to change the headertext after... -
How do I change the headertext of a datagrid column programmatically
Hi, I have a datagrid to view the results from a database. I am using autogenerate because the number of columns returned from the database... -
change HeaderText of DataGrid in PreRender().
I need change HeaderText of DataGrid in PreRender(). But it seems doesn't work. The code example like this: Protected Overrides Sub... -
How to change datagrid column HeaderText from C#
You can do thisn DataGrid_ItemCreated Event HTH Prasad "MarkMurphy" <murphy@murphysw.com> wrote in message... -
SB #2
Re: DataGrid Dynamic HeaderText
Seli,
You can do that in the ItemCreated event.of the DataGrid.
Make sure that you only apply the value when the IteMType is of type header
=>
//I write from scratch, not Iin VS so there might be typo mistakes
if (e.Item.ItemType==ListItemType.HeaderItem){
e.Item[0].HeaderText="MARCEL";
}
Selim
"Seli" <anonymous@discussions.microsoft.com> wrote in message
news:0D61DB9E-6B3A-4247-9955-03315AD1AD78@microsoft.com...Returns 0!!> Hello
>
> How can I change the headerText of an AutoGenerateColumns DataGrid?
>
> myDataGrid.DataSource=ds.Tables["Products"].DefaultView;
> myDataGrid.DataBind();
> myDataGrid.Columns[0].HeaderText="MARCEL";
>
> in the third line I get always an exception. myDataGrid.Colums.count>
> Thanks
> Seli
SB Guest



Reply With Quote

