Ask a Question related to ASP.NET Data Grid Control, Design and Development.
-
Mike Smith #1
Edit DataGrid Header
Hey ppl...
I got my datagrid column edited by coding the ItemDataBound event with the
following code:
If e.Item.ItemType=ListItemType.Header Then
e.Item.Cells(6).Text="Rental (USD)"
End if
I find that when i display the grid now, the column headers doesn't have the
hyperlink behavior and therefore i cant sort it. How do i go about adding
the hyperlink behavior ? Why does it go off when you change the header ?
regards,
Mike
Mike Smith Guest
-
Would like to load a datagrid already in edit mode instead of having the user click the edit button
Now my asp.net datagrid shows an edit button and clicking it puts the datagrid in edit mode. I would like to: 1) possilby load the page already... -
Set the width of the edit textbox after clicking on Edit link in datagrid...
Hi There, I have a data grid where I have a couple of columns as follows: ----------------------------------------- |id | textual... -
DataGrid easy Edit-Update using ADO.NET/DataGrid functionality C#?
Hi, so I am using built in Edit, Delete, Update i.e. OnEditCommand="DataGrid1_Edit" OnUpdateCommand="DataGrid1_Update" with handler question below... -
datagrid header
Is it possible to have an overall header that spans across all columns? An example would be a class schedule for student Ben. |Ben |English ... -
To all Gurus: How can I edit/update a DataGrid in a DataGrid (nested DataGrid)? Possible?
Hello, I am searching the whole Internet for a good example how to edit/update a DataGrid in a DataGrid (nested DataGrid). I know how to... -
Jos #2
Re: Edit DataGrid Header
Mike Smith wrote:
What about:> Hey ppl...
>
> I got my datagrid column edited by coding the ItemDataBound event
> with the following code:
>
> If e.Item.ItemType=ListItemType.Header Then
> e.Item.Cells(6).Text="Rental (USD)"
> End if
>
> I find that when i display the grid now, the column headers doesn't
> have the hyperlink behavior and therefore i cant sort it. How do i go
> about adding the hyperlink behavior ? Why does it go off when you
> change the header ?
>
> regards,
> Mike
(CType(e.Item.Cells(6).Controls(0),HyperLink)).Tex t="Rental (USD)"
--
Jos
Jos Guest
-
Mike Smith #3
Re: Edit DataGrid Header
hey jos...
i tried that code out.. didnt seem to work ... the column retained its
original name itself as RENTAL
it wasnt assigned the new RENTAL (USD) .
Any other suggestions ?
is there a recommended best practice in dealin with datagrids and data ?
Boundcolumns ? guess i have to sit my butt down and do the templates and all
that ?
"Jos" <josnospambranders@fastmail.fm> wrote in message
news:uvjhUcCgDHA.3228@tk2msftngp13.phx.gbl...> Mike Smith wrote:>> > Hey ppl...
> >
> > I got my datagrid column edited by coding the ItemDataBound event
> > with the following code:
> >
> > If e.Item.ItemType=ListItemType.Header Then
> > e.Item.Cells(6).Text="Rental (USD)"
> > End if
> >
> > I find that when i display the grid now, the column headers doesn't
> > have the hyperlink behavior and therefore i cant sort it. How do i go
> > about adding the hyperlink behavior ? Why does it go off when you
> > change the header ?
> >
> > regards,
> > Mike
> What about:
> (CType(e.Item.Cells(6).Controls(0),HyperLink)).Tex t="Rental (USD)"
>
> --
>
> Jos
>
>
Mike Smith Guest
-
Stevie_mac #4
Re: Edit DataGrid Header
Do wot jos sed - but in ItemCreated event instead!
"Mike Smith" <manilamike2000@yahoo.com> wrote in message news:OcqHjGFgDHA.3616@TK2MSFTNGP11.phx.gbl...> hey jos...
> i tried that code out.. didnt seem to work ... the column retained its
> original name itself as RENTAL
> it wasnt assigned the new RENTAL (USD) .
> Any other suggestions ?
> is there a recommended best practice in dealin with datagrids and data ?
> Boundcolumns ? guess i have to sit my butt down and do the templates and all
> that ?
>
> "Jos" <josnospambranders@fastmail.fm> wrote in message
> news:uvjhUcCgDHA.3228@tk2msftngp13.phx.gbl...>> > Mike Smith wrote:> >> > > Hey ppl...
> > >
> > > I got my datagrid column edited by coding the ItemDataBound event
> > > with the following code:
> > >
> > > If e.Item.ItemType=ListItemType.Header Then
> > > e.Item.Cells(6).Text="Rental (USD)"
> > > End if
> > >
> > > I find that when i display the grid now, the column headers doesn't
> > > have the hyperlink behavior and therefore i cant sort it. How do i go
> > > about adding the hyperlink behavior ? Why does it go off when you
> > > change the header ?
> > >
> > > regards,
> > > Mike
> > What about:
> > (CType(e.Item.Cells(6).Controls(0),HyperLink)).Tex t="Rental (USD)"
> >
> > --
> >
> > Jos
> >
> >
>
Stevie_mac Guest
-
Mike Smith #5
Re: Edit DataGrid Header
i got it done in ItemDataBound....
it was LinkButton instead
CType(e.Item.Cells(6).Controls(0), LinkButton).Text = "Rental (USD)"
Thank JOS !
"Stevie_mac" <no.email@please.com> wrote in message
news:bkks8f$8uc$1@newsg4.svr.pol.co.uk...news:OcqHjGFgDHA.3616@TK2MSFTNGP11.phx.gbl...> Do wot jos sed - but in ItemCreated event instead!
>
> "Mike Smith" <manilamike2000@yahoo.com> wrote in messageall> > hey jos...
> > i tried that code out.. didnt seem to work ... the column retained its
> > original name itself as RENTAL
> > it wasnt assigned the new RENTAL (USD) .
> > Any other suggestions ?
> > is there a recommended best practice in dealin with datagrids and data ?
> > Boundcolumns ? guess i have to sit my butt down and do the templates andgo> > that ?
> >
> > "Jos" <josnospambranders@fastmail.fm> wrote in message
> > news:uvjhUcCgDHA.3228@tk2msftngp13.phx.gbl...> > > Mike Smith wrote:
> > > > Hey ppl...
> > > >
> > > > I got my datagrid column edited by coding the ItemDataBound event
> > > > with the following code:
> > > >
> > > > If e.Item.ItemType=ListItemType.Header Then
> > > > e.Item.Cells(6).Text="Rental (USD)"
> > > > End if
> > > >
> > > > I find that when i display the grid now, the column headers doesn't
> > > > have the hyperlink behavior and therefore i cant sort it. How do i>> >> > > > about adding the hyperlink behavior ? Why does it go off when you
> > > > change the header ?
> > > >
> > > > regards,
> > > > Mike
> > >
> > > What about:
> > > (CType(e.Item.Cells(6).Controls(0),HyperLink)).Tex t="Rental (USD)"
> > >
> > > --
> > >
> > > Jos
> > >
> > >
> >
>
Mike Smith Guest



Reply With Quote

