|
Home > Archive > microsoft.public.cert.exam.mcsd > November 2002 > Tricky MCSD.NET question
You are viewing an archived Text-only version of the thread.
To view this thread in it's original format and/or if you want to reply to
this thread please [click here]
| Author |
Tricky MCSD.NET question
|
|
|
| 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
| |
| Philip Q [MVP] 2002-11-17, 3:23 am |
| I would pick C as well. Mainly because you can use the DataGridItemEventArgs
(which you don't get with the PreRender event) to quickly locate the column
and change the color of it (I think it can be done in 1 line of code).
--
Philip Quinn - wisemonk@aspalliance.com
Microsoft MVP (ASP.NET)
Anything Goes ASP -
http://www.aspalliance.com/wisemonk/
"Sada" <sadamahan@hotmail.com> wrote in message
news:#s8O2HhjCHA.440@tkmsftngp11...
> 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
>
>
>
|
|
|
|
|