473,396 Members | 1,832 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,396 software developers and data experts.

how to get object from gridview control while rendering

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<Objectwith 5 items.
i would appriciate any help.

thanks,

Lucky

Mar 6 '07 #1
2 1596
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.

"Lucky" <tu************@gmail.comwrote in message
news:11**********************@t69g2000cwt.googlegr oups.com...
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<Objectwith 5 items.
i would appriciate any help.

thanks,

Lucky

Mar 6 '07 #2
On Mar 6, 10:45 am, "Aidy" <a...@noemail.xxxa.comwrote:
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.

"Lucky" <tushar.n.pa...@gmail.comwrote in message

news:11**********************@t69g2000cwt.googlegr oups.com...
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<Objectwith 5 items.
i would appriciate any help.
thanks,
Lucky
Pal,
the function GetStatus() is returnin BOOL value. so i guess the
"checked" prop. will get the correct value from the object.

Mar 6 '07 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

3
by: | last post by:
Hello, I have created an ASP.NET 2.0 application that utilized a Gridview Control to display and update/delete data. The problem I am having is that the gridview control is displaying the data...
7
by: | last post by:
Hello, Does anyone have an idea on how I can filter the data in the gridview control that was returned by an sql query? I have a gridview that works fine when I populate it with data. Now I...
3
by: chelsea | last post by:
I am using a GridView control with a ButtonField and receiving 2 row command events for each click of the button. Is there a configuration switch that I can turn that will ensure I only receive...
0
by: John Smith | last post by:
ASP.Net 2.0 / C# / IIS 6 I have 2 pages. The master page consists of a tabbed menu created using the Menu and MultiView controls. Something like this: ...
1
by: spitapps | last post by:
I have a gridview declaratively added to my webform. This gridview displays data from a stored procedure returned as a dataset. Once the dataset has been modified slightly i bind it to my...
11
by: HEX | last post by:
Have a page developed w/VWD which has a Gridview control. XHTML 1.0 Transitional Doctype. Tested in VWD OK and renders in IE7 as tested. When rendered with Firefox, the Gridview is shifted far to the...
0
by: =?Utf-8?B?Um9iZXJ0IFNtaXRo?= | last post by:
Hello I have some code to extend the gridview control as shown that hides the Select button and underlines the text as you scroll on it. I have also overridden the SelectIndexChanged event so...
6
by: =?Utf-8?B?UGF1bA==?= | last post by:
Hi I have a gridview control with a template column that has a textbox and when the control is bound to the datasource the textbox is filled ok. I then change what is in the textbox in the gridview...
1
bagrigsb
by: bagrigsb | last post by:
My project is fairly simple, since I am a relative noobie to VB.NET. Using a Windows Form with a Menu bar and a Gridview control, I have bound data to the GridView from an MS Access 2000 database...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.