Thanks Natty
I was missing the label control in the template column. I had some
True/False fields in my DataGrid and that's why i changed my DataGrid to use
Template columns so i could use checkboxes in it but for the display i used
this
<ItemTemplate><%# DataBinder.Eval(Container.DataItem, "AIT")
%></ItemTemplate>
<edititemtemplate><asp:CheckBox ID="chkEditAit" Checked=<%#
CheckBoxValueConverter(Container.DataItem("AIT")) %>
runat="server"/></edititemtemplate>
instead of this
<ItemTemplate><asp:Label ID="Label_4" Text=<%#
DataBinder.Eval(Container.DataItem, "AIT") %>
runat="server"/></ItemTemplate>
<edititemtemplate><asp:CheckBox ID="chkEditAit" Checked=<%#
CheckBoxValueConverter(Container.DataItem("AIT")) %>
runat="server"/></edititemtemplate>
The result was fine so i was fixed to find the problem elsewhere :)
Now, why I am using OnItemDataBound :
Well, OnItemDataBound I am checking the values of all the fields and
depending on those values i am changing the display property of the given
Cell. For example if a cell value is less than some given value then Cell's
background is red, etc.
Thanks a lot.
Raja
[quoted text, click to view] "Natty Gur" <natty@dao2com.com> wrote in message
news:up2Tss6QEHA.1312@TK2MSFTNGP12.phx.gbl...
> Hi,
>
>
> Template controls should hold inner control/s. you should access them
> (inner controls) by using findcontrol to get reference to the template
> inner control.
>
> by the way why do you use OnItemDataBound event which fire when data
> binds into grid item to get data grid items data ?
>
>
> Natty Gur[MVP]
>
> blog :
http://weblogs.asp.net/ngur > Mobile: +972-(0)58-888377
>
>
> *** Sent via Developersdex
http://www.developersdex.com ***
> Don't just participate in USENET...get rewarded for it!