Ask a Question related to ASP.NET Data Grid Control, Design and Development.
-
mor #1
access control in header template
I got a label control which is dynamically created inside the
headerTemplate of template column.
And it is part of the datagrid.
Please teach me how to read the content of that label control?
I cannot use FindControl() function because it is created in runtime
based on variable.
And everytime the number of columns is different.
I can access a textbox control in itemTemplate with following code
(dgassignment is the datagrid)
dim i as integer
dim j as integer
dim textboxhour as textbox
dim dgi as datagriditem
for i = 0 to dgassignment.items.count -1
dgi = dgassignment.items(i)
for j = 0 to dgi.cells.count -1
textboxhour = ctype(dgi.cells(j).controls(0), textbox)
next j
next i
But I have no idea how to get the control in header, please help,
thanks.
mor Guest
-
Best way to integrate Flash header into PHP web-template...
Hi all, thanks in advance for the read-through. I have created an animation (about 10 secs) that I hope to use as the header for my PHP web-site... -
Header in a template column
Hi, I have a checkbox in the header of a template column in a datagrid. How can I check during runtime that whether checkbox is checked or not?I... -
New template in word does not show header/footer
When opening a new template in word, the document does not automtaically show the header/footer. I have checked the page set-up and tried to alter... -
Problem to Access web control on the DataGrid Header
Hi The Items Collection of DataGrid does not hold Header and Footer. So to access the Control you need to handle ItemCreated event. HTH... -
Template Column with button in header
Hi, usually Button clicks inside DataGrid are managed by handling ItemCommand event of the grid. Button is given a CommandName that is checked in... -
Ben Miller [MSFT] #2
Re: access control in header template
Couldn't you just use the ItemDataBound event on the datagrid and test for
the itemType = Header?
sub DataGrid_ItemDataBound(sender as object, e as DataGridItemEventArgs)
if e.Item.ItemType = ListItemType.Header Then
do a findcontrol() here.
end if
end Sub
HTH.
Ben Miller
--
Get Secure! - [url]www.microsoft.com/security[/url]
This posting is provided "as is" with no warranties and confers no rights.
"mor" <royguard@hotmail.com> wrote in message
news:177c14a0.0405271806.5eadc445@posting.google.c om...> I got a label control which is dynamically created inside the
> headerTemplate of template column.
> And it is part of the datagrid.
>
>
> Please teach me how to read the content of that label control?
>
> I cannot use FindControl() function because it is created in runtime
> based on variable.
> And everytime the number of columns is different.
>
> I can access a textbox control in itemTemplate with following code
> (dgassignment is the datagrid)
>
> dim i as integer
> dim j as integer
> dim textboxhour as textbox
> dim dgi as datagriditem
>
> for i = 0 to dgassignment.items.count -1
> dgi = dgassignment.items(i)
> for j = 0 to dgi.cells.count -1
> textboxhour = ctype(dgi.cells(j).controls(0), textbox)
> next j
> next i
>
> But I have no idea how to get the control in header, please help,
> thanks.
Ben Miller [MSFT] Guest



Reply With Quote

