Items collection. The header, footer, and separator are not included in
"S.M. Altaf [MVP]" <smaltaf@PLEASEDONTSPAMMEmsn.com> wrote in message
news:Oaeti3G5FHA.1028@TK2MSFTNGP11.phx.gbl...
> That isn't very difficult.
>
> Loop through the DataGridItemCollection. Start by looking for ItemType =
> Header. In the header, you can go through each cell and do a
> .FindControl() for the control that you have in your header (and assuming
> you have given each control an ID). CTYpe() the control to the control
> type that you put there, and then access the values that you want.
>
> HTH
> ALtaf
> --------------------------------------------------------------------------------
> All that glitters has a high refractive index.
>
www.mendhak.com >
>
> "Tumurbaatar S." <spam_tumur@magicnet.mn> wrote in message
> news:%237j1C$E5FHA.692@TK2MSFTNGP11.phx.gbl...
>> Thank you!
>> I've added controls to my datagrid's footer and pager. And now I can
>> customize them at item's Create or DataBound events. But I cannot find
>> a method to access these controls after, for example, after postback.
>> DataGrid.Items contains only normal item rows. The header/footer/pagers
>> are not included in this collection. My datagrid has several controls
>> on the footer row and I do postback using some button. And within
>> this button's Click event handler I need to examine content of these
>> controls. Any ideas?
>> Also, in several articles about adding controls to the pager, for
>> example,
>> I saw that before dynamically adding a control, authors check out whether
>> this control was added in prior round trips. They says that the datagrid
>> can save previously added control and without checking this, it may
>> lead to duplicate controls. In my code I don't check it and all work
>> normally: no duplicated/doubled controls. Anybody can explain this?
>>
>>
>>
>> "S.M. Altaf [MVP]" <smaltaf@PLEASEDONTSPAMMEmsn.com> wrote in message
>> news:exVJbhU4FHA.1140@tk2msftngp13.phx.gbl...
>>> Hi,
>>>
>>> In the ItemDataBound event of the datagrid, you can add the controls to
>>> the datagrid header cells programmatically, or you can take a look at
>>> HeaderTemplates.
>>>
>>> Instead of giving you a link, I'll just give you the google search URL:
>>>
>>>
http://www.google.com/search?q=asp.net+datagrid+headertemplate&btnG=Search&hs=Gpg&hl=en&lr=&safe=off&client=firefox-a&rls=org.mozilla%3Aen-US%3Aofficial
>>>
>>> HTH
>>>
>>> -Altaf
>>> --------------------------------------------------------------------------------
>>> All that glitters has a high refractive index.
>>>
www.mendhak.com >>>
>>>
>>> "Tumurbaatar S." <spam_tumur@magicnet.mn> wrote in message
>>> news:u%23w5PxQ4FHA.1416@TK2MSFTNGP09.phx.gbl...
>>>>I need to put web controls inside pager, header or footer
>>>> parts of the datagrid. Any ideas?
>>>>
>>>>
>>>
>>>
>>
>>
>
>