J
Jason S
I haven't been able to find a clear answer to this and I'm hoping someone
could enlighten me.
As pertains to databinding a control in a repeating fashion(datagrid,
repeater, etc.) what event would one handle to get a handle on things just
BEFORE the data is bound. To be clearer, not controlling the formatting of
the bound control(backcolor or what have you), but rather control the WAYor
even IF the data is bound at all.
For instance, in the context of active directory calls some results come
back in a non deterministic way. In one result of an ADSI query I could
have an item with a "phonenumber" property and the very next result could
have no such property. It simply isn't present. Kind of like a ragged
array I guess you could say. When the databinder gets to that entry it
throws an index out of range exception/COM exception, etc.
So back to my question... what event allows me to come in BEFORE the data is
bound and have the bindee dataitem there for inspection? Essentially,
control the entire process. It appears that ItemDataBound is after the fact
and is merely for tidying up. I couldn't tell if the DataBinding event or
the ItemCreated would help me get closer or not. They way I am working with
it now is by page level databinding statements such as:
<%#
((SearchResult)Container.DataItem).Properties.Contains("telephonenumber") ?
((SearchResult)Container.DataItem).Properties["telephonenumber"][0] :
"[blank]" %>
What is the code level equivalent of this action? This seems like such a
common thing to do but I can't find a good description of the process.
TIA,
Jason S.
could enlighten me.
As pertains to databinding a control in a repeating fashion(datagrid,
repeater, etc.) what event would one handle to get a handle on things just
BEFORE the data is bound. To be clearer, not controlling the formatting of
the bound control(backcolor or what have you), but rather control the WAYor
even IF the data is bound at all.
For instance, in the context of active directory calls some results come
back in a non deterministic way. In one result of an ADSI query I could
have an item with a "phonenumber" property and the very next result could
have no such property. It simply isn't present. Kind of like a ragged
array I guess you could say. When the databinder gets to that entry it
throws an index out of range exception/COM exception, etc.
So back to my question... what event allows me to come in BEFORE the data is
bound and have the bindee dataitem there for inspection? Essentially,
control the entire process. It appears that ItemDataBound is after the fact
and is merely for tidying up. I couldn't tell if the DataBinding event or
the ItemCreated would help me get closer or not. They way I am working with
it now is by page level databinding statements such as:
<%#
((SearchResult)Container.DataItem).Properties.Contains("telephonenumber") ?
((SearchResult)Container.DataItem).Properties["telephonenumber"][0] :
"[blank]" %>
What is the code level equivalent of this action? This seems like such a
common thing to do but I can't find a good description of the process.
TIA,
Jason S.