| | |
Checking Number in a String and calculate..
Please support our ASP.NET advertiser: PostgreSQL or MySQL? Compare and contrast the two most popular open source databases
Thread Solved |
•
•
Join Date: Jan 2008
Posts: 25
Reputation:
Solved Threads: 0
Hi fellows,
My problem is, i have a datagrid where there is a boundcolumn which consists of Cadre(E1,E2.....E7).
In the same datagrid i also have two template column which consists of a textbox and a checkbox.I need to enable the textbox and check the checkbox by considering the cadre.The logic is that i got 60 employees in teh grid with various Cadre.I want to enable the textbox and Check box to the employee whose cadre is above E4(E4,E3,E2,E1).
I did this by using select case..
But i would like to try it by keeping constant "E" and calculate the number using a IF Condition.This is what i did.
It is returning me all 0's..Could anyone help me on this.
My problem is, i have a datagrid where there is a boundcolumn which consists of Cadre(E1,E2.....E7).
In the same datagrid i also have two template column which consists of a textbox and a checkbox.I need to enable the textbox and check the checkbox by considering the cadre.The logic is that i got 60 employees in teh grid with various Cadre.I want to enable the textbox and Check box to the employee whose cadre is above E4(E4,E3,E2,E1).
I did this by using select case..
ASP.NET Syntax (Toggle Plain Text)
Select Case DGridItem.Cells(8).Text Case "E4" txtLTa.ReadOnly = False CbLTA.Checked = True Case "E3" txtLTa.ReadOnly = False CbLTA.Checked = True Case "E2" txtLTa.ReadOnly = False CbLTA.Checked = True Case "E1" txtLTa.ReadOnly = False CbLTA.Checked = True Case Else CbLTA.Visible = False txtLTa.Visible = False End Select
But i would like to try it by keeping constant "E" and calculate the number using a IF Condition.This is what i did.
ASP.NET Syntax (Toggle Plain Text)
Dim PRCbLTA As String Dim CbLTA As CheckBox Dim txtLTa As TextBox Dim PRLta As Decimal txtLTa = CType(DGridItem.FindControl("txtLTA"), TextBox) CbLTA = CType(DGridItem.FindControl("CbLTA"), CheckBox) Dim Grade As String Grade = DGridItem.Cells(8).Text Dim i As Integer If Grade = "E" & i <= 4 Then Response.Write(i) End IF
•
•
Join Date: Jan 2008
Posts: 25
Reputation:
Solved Threads: 0
Thanks for viewing.
I myself solved it..Thanks anyway...
Here is the Code.I used Replace
I myself solved it..Thanks anyway...
Here is the Code.I used Replace
ASP.NET Syntax (Toggle Plain Text)
Dim PRCbLTA As String Dim CbLTA As CheckBox Dim txtLTa As TextBox Dim PRLta As Decimal txtLTa = CType(DGridItem.FindControl("txtLTA"), TextBox) CbLTA = CType(DGridItem.FindControl("CbLTA"), CheckBox) Dim Grade As String Grade = Replace(DGridItem.Cells(8).Text, "E", "") If Grade <= 4 Then txtLTa.ReadOnly = False CbLTA.Checked = True Else CbLTA.Visible = False txtLTa.Visible = False End If
![]() |
Similar Threads
- program blows up (C++)
- Overloaded Function Help (C++)
- Making my void functions look at little better (C++)
- newbie in need of help for hangman game (Python)
- Solution for Big Integer used Linked - List. (C++)
- GUI buttons Inventory Part 5 (Java)
- help help plzzzzzzzz (Java)
Other Threads in the ASP.NET Forum
- Previous Thread: String was not recognized as a valid DateTime.
- Next Thread: Formatted text control
Views: 742 | Replies: 1
| Thread Tools | Search this Thread |
Tag cloud for ASP.NET
.net 2.0 3.5 ajax appliances application asp asp.net beginner box browser businesslogiclayer button c# cac checkbox child class compatible complex content contenttype control countryselector courier database datagrid datagridview datalist deployment development dgv dialog dropdown dropdownmenu dynamic dynamically edit editing embeddingactivexcontrol feedback fileuploader fill findcontrol flash flv folder form gridview gudi identity iis image javascript languages list maps menu mobile mssql nameisnotdeclared novell opera order problem profile ratings redirect refer registration relationaldatabases response.redirect rows search security select serializesmo.table sessionvariables silverlight smoobjects software sql ssl tracking treeview typeof validatedate validation vb vb.net vista visual-studio visualstudio vs2008 web webapplications webarchitecture webdevelopment wizard xsl





