how to get object from gridview control while rendering

L

Lucky

Hi guys,
i've problem with GridView control as i'm just learing Asp.net i dont
know most of the things.
here, my problem.

i'm using GridView control with Template columns, it looks like this:

<asp:GridView runat="server" ID="GridView1"
AutoGenerateColumns="False" Width="90%">
<Columns>
<asp:TemplateField>
<ItemTemplate>
<asp:CheckBox runat="server" ID="chkVal" Checked='<
%#GetStatus(Eval("Stat")) %>' />
</ItemTemplate>
</asp:TemplateField>
</Columns>
</asp:GridView>

this is working fine. now i want to pass the whole object instead of
its property. and i dont know how to do that.
what i mean is insetead of doing this way "<%#GetStatus(Eval("Stat"))
%>" i want to pass the whole object insted of passing property
like this "<%#GetStatus(this) %>".

is it possible to do so?

the binding source to the grid is IList<Object> with 5 items.


i would appriciate any help.

thanks,

Lucky
 
A

Aidy

The checked property must be true or false, how would assigning it an object
work? In short, I think you need to re-think what you want to do.
 
L

Lucky

The checked property must be true or false, how would assigning it an object
work? In short, I think you need to re-think what you want to do.

Pal,
the function GetStatus() is returnin BOOL value. so i guess the
"checked" prop. will get the correct value from the object.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top