473,509 Members | 2,918 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

change gridview values

115 New Member
hi
how can i change gridview value
this is my code
Expand|Select|Wrap|Line Numbers
  1. <asp:TemplateField HeaderText="currstatus" SortExpression="currstatus">                
  2.                 <ItemTemplate>
  3.                  <asp:Label ID="Label1" runat="server" Text='<%#(string) printstatus((string)Eval("currstatus")) %>'></asp:Label>
  4.                 </ItemTemplate>
  5.             </asp:TemplateField>
  6.  
  7.  
cs file
Expand|Select|Wrap|Line Numbers
  1. public string printstatus(string val)
  2.     {
  3.         string retval="In Active";
  4.         if (val == "1")
  5.         {
  6.             retval = "Active";
  7.         }
  8.  
  9.         return retval;
  10.     }
  11.  
it is not working it gives error

pls help me
Jun 28 '09 #1
1 1443
yogarajan
115 New Member
hi all

my problem solve

pls change code
<asp:Label ID="Label1" runat="server" Text='<%#(string) printstatus((string)Eval("currstatus")) %>'></asp:Label>

to
<asp:Label ID="Label1" runat="server" Text='<%#printstatus(("currstatus").ToString()) %>'></asp:Label>


thanks
Jun 30 '09 #2

Sign in to post your reply or Sign up for a free account.

Similar topics

7
14784
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...
1
3224
by: Giovanni | last post by:
Dear Friends/Gurus, I have exhausted myself and have yet no solution to the following: I have an ASP.NET 2.0 Survey type application. On a page, I have placed a GridView which is bound to an...
3
1969
by: Richard Carpenter | last post by:
I have a simple winform with a customers combobox, a "get orders" button and an orders grid. Due to other requirements, I have implemented the form to allow the user to select a customer from the...
1
1824
by: martin1 | last post by:
Hi, All, Anyone knows how to change gridview text info? specifically the gridview populate from sql db, first column is string rather than number, i want to change first row in first column into...
6
17889
by: Greg | last post by:
Hello, I have a GridView bound to a custom object. I set the DataKeyNames property along with the column DataField properties at design time, and bind the GridView to my object at run-time. In...
4
3477
by: =?Utf-8?B?Y2hyaXM=?= | last post by:
I have a perent gridview which includes in a template field a child gridview. Child gridview includes command buttons for opening different windows based on its row selected. I used the code...
3
7315
by: pvong | last post by:
VB.NET How do you change a gridview from Update mode to normal mode? I'm usually dealing for Formviews and there is a ChangeMode option but I don't see one for Gridviews.
4
6032
by: tim.cavins | last post by:
I have a GridView populated by an ObjectDataSource. I am having issues passing the parameters to the objectdatasource. I have verified that the method is being called but none of the parameters...
6
2282
by: thanigaimani83 | last post by:
Hi guys. i can explain for my doubt with example.see.my table have multiple type of employee details like as Mangemment,Programmer,Designers,Accountants,ContractEmployees.Each type of department...
0
1557
by: =?Utf-8?B?UGhpbCBKb2huc29u?= | last post by:
Hi, I need to have a column in a gridview that cycles through a set of comma delimited values i.e. if you imagine a column where in one row the value might be "111,222" and in the next row it...
0
7137
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
7347
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
7416
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...
1
7073
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
7506
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...
0
3218
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The...
0
3207
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
779
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
0
443
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence...

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.