| DFoderick 2002-11-18, 12:23 pm |
| I would pick c, too.
a. is too soon, you dont have the bound values to decide
how to change the colors
b. obviously wrong
c. Everything is known: The control item and the data. You
can easily make a determination and change the attributes
of the control to make it appear how you want.
d. It would be too difficult to iterate over all the
controls and figure out what data was bound to what
control.
Dave
http://www.netknowledgenow.com
>-----Original Message-----
>Hi,
>
>I came across the following question in a sample test on
a web site:
>
>If you were to change the colors of the values displayed
in a certain column
>of a DataGrid control, what event of the DataGrid control
should you use to
>implement the color scheme?
>
>a. ItemCreated event
>b. SelectedIndexChanged event
>c. ItemDataBound even
>d. PreRender event.
>
>I think d should be the correct answer because at the
time of rendering,
>you know the value that has to be displayed in the column
of the datagrid
>and you can change the color based on the value.
>
>But the correct answer has been given as c with the
explanation:
>
>" When the ItemDataBound is raised, access the data that
will be rendered to
>the cell with Item.Controls property of
DataGridItemEventArgs parameter e."
>
>The question does not make sense to me. Does it to
anybody? Why not d?
>
>Thanks
>
>Sada
>
>
>
>.
>
|