Register Register Member Login Member Login Member Login Forgot Password ??
PHP , ASP , ASP.NET, VB.NET, C#, Java , jQuery , Android , iOS , Windows Phone
 

Registered : 109,038

HOME > .NET Framework > Forum > ช่วยเพิ่มเติมหน่อยครับ เลือก RadioButton ใน GridView โดยทำทีละ Row คือทำทีละข้อ กดข้อ1 แล้วข้อ2กดต่อได้



 

[.NET] ช่วยเพิ่มเติมหน่อยครับ เลือก RadioButton ใน GridView โดยทำทีละ Row คือทำทีละข้อ กดข้อ1 แล้วข้อ2กดต่อได้

 



Topic : 062747



โพสกระทู้ ( 36 )
บทความ ( 0 )



สถานะออฟไลน์




ช่วยเพิ่มเติมหน่อยครับ เลือก radiobutton ในgridview โดยทำทีละ row คือทำทีละข้อ กดข้อ1 แล้วข้อ2กดต่อได้
ทำทีละข้อลงมาเรื่อยๆ เป็นฟังก์ชั่นก็ได้คับ radioutton มี10อัน แต่ละอันอยู่คนละฟิวล์กัน

table2

โค้ด

Code (VB.NET)
001.Public Function SaveGrid(ByVal objGv As GridView, ByVal newID As Integer) As Boolean
002. 
003. 
004. 
005. 
006.        Dim gvr As GridViewRow
007. 
008.        Dim i As Integer = 0
009.        Dim Score As Integer
010.        Dim gvComment As String
011.        Dim Radioname As String
012.        Dim Textboxname As String
013. 
014. 
015.        With objGv
016.            For Each gvr In .Rows
017. 
018.                Dim rd10 As RadioButton
019.                Radioname = .ID & "_10"
020.                rd10 = CType(.Rows(i).FindControl(Radioname), RadioButton)
021.                'Label10.Text += CStr(rd10.Checked).ToString & "<br>"
022.                If rd10.Checked Then
023.                    'Label14.Text += .Rows(i).Cells(0).Text & rd10.Checked
024.                    'Label13.Text += "10,"
025.                    Score = 10
026.                End If
027. 
028.                Dim rd9 As RadioButton
029.                Radioname = .ID & "_9"
030.                rd9 = CType(.Rows(i).FindControl(Radioname), RadioButton)
031.                If rd9.Checked Then
032.                    Score = 9
033.                End If
034. 
035.                Dim rd8 As RadioButton
036.                Radioname = .ID & "_8"
037.                rd8 = CType(.Rows(i).FindControl(Radioname), RadioButton)
038.                If rd8.Checked Then
039.                    Score = 8
040.                End If
041. 
042.                Dim rd7 As RadioButton
043.                Radioname = .ID & "_7"
044.                rd7 = CType(.Rows(i).FindControl(Radioname), RadioButton)
045.                If rd7.Checked Then
046.                    Score = 7
047. 
048.                End If
049. 
050.                Dim rd6 As RadioButton
051.                Radioname = .ID & "_6"
052.                rd6 = CType(.Rows(i).FindControl(Radioname), RadioButton)
053.                If rd6.Checked Then
054.                    Score = 6
055.                End If
056. 
057.                Dim rd5 As RadioButton
058.                Radioname = .ID & "_5"
059.                rd5 = CType(.Rows(i).FindControl(Radioname), RadioButton)
060.                If rd5.Checked Then
061.                    Score = 5
062.                End If
063. 
064.                Dim rd4 As RadioButton
065.                Radioname = .ID & "_4"
066.                rd4 = CType(.Rows(i).FindControl(Radioname), RadioButton)
067.                If rd4.Checked Then
068.                    Score = 4
069.                End If
070. 
071.                Dim rd3 As RadioButton
072.                Radioname = .ID & "_3"
073.                rd3 = CType(.Rows(i).FindControl(Radioname), RadioButton)
074.                If rd3.Checked Then
075.                    Score = 3
076.                End If
077. 
078.                Dim rd2 As RadioButton
079.                Radioname = .ID & "_2"
080.                rd2 = CType(.Rows(i).FindControl(Radioname), RadioButton)
081.                If rd2.Checked Then
082.                    Score = 2
083.                End If
084. 
085.                Dim rd1 As RadioButton
086.                Radioname = .ID & "_1"
087.                rd1 = CType(.Rows(i).FindControl(Radioname), RadioButton)
088.                If rd1.Checked Then
089.                    Score = 1
090.                End If
091. 
092.                Dim rd0 As RadioButton
093.                Radioname = .ID & "_0"
094.                rd0 = CType(.Rows(i).FindControl(Radioname), RadioButton)
095.                If rd0.Checked Then
096. 
097.                    Score = 0
098. 
099.                End If
100. 
101.                Dim txtcomment As TextBox
102.                Textboxname = .ID & "_comment"
103.                txtcomment = CType(.Rows(i).FindControl(Textboxname), TextBox)
104.                If rd0.Checked Then
105.                    'Label14.Text += .Rows(i).Cells(0).Text & "0"
106.                    'Label13.Text += "0"
107.                    gvComment = (.ID & "_comment").ToString
108. 
109.                End If
110. 
111.                 
112. 
113.                'ds = CType(Session("ds"), DataSet)
114.                'ds2 = CType(Session("ds"), DataSet)
115. 
116. 
117. 
118.                Select Case objGv.ID
119.                    Case "gvchk1"
120.                        Me.AddInspectDetail(newID, CInt(gvr.Cells(0).Text), Score, txtcomment.Text)
121. 
122.                    Case "gvchk2"
123.                        'i = i
124.                        'Dim teststr As String = gvr.Cells(0).Text
125.                        Me.AddInspectDetail(newID, CInt(gvr.Cells(0).Text), Score, txtcomment.Text)
126. 
127.                    Case "gvchk3"
128.                        Me.AddInspectDetail(newID, CInt(gvr.Cells(0).Text), Score, txtcomment.Text)
129. 
130. 
131.                    Case "gvchk4"
132.                        Me.AddInspectDetail(newID, CInt(gvr.Cells(0).Text), Score, txtcomment.Text)
133.                End Select
134. 
135. 
136.                'Me.AddInspectDetail(newId, CType(ds.Tables(0).Rows(i)("ItemID").ToString, Integer), Score)
137. 
138.                i += 1
139.            Next
140.            .Enabled = False
141.        End With
142. 
143.    End Function




Tag : .NET, Web (ASP.NET), VB.NET







Move To Hilight (Stock) 
Send To Friend.Bookmark.
Date : 2011-07-05 13:58:01 By : mamanakin View : 1298 Reply : 4
 

 

No. 1



โพสกระทู้ ( 74,059 )
บทความ ( 838 )

สมาชิกที่ใส่เสื้อไทยครีเอท

สถานะออฟไลน์
Twitter Facebook

ถ้าจะให้ Disable ปุ่มคงจะต้องใช้ JavaScript เข้ามาช่วยครับ ซึ่งอาจจะยากนิดหนึ่งครับ






แสดงความคิดเห็นโดยอ้างถึง ความคิดเห็นนี้
Date : 2011-07-05 17:58:06 By : webmaster
 


 

No. 2



โพสกระทู้ ( 36 )
บทความ ( 0 )



สถานะออฟไลน์


พี่พอช่วยได้ไหมอ่ะคับ รบกวนแนะนำด้วยคับ ต้องทำยังไง เอาjava ไปวางไว้ตรงไหน
แสดงความคิดเห็นโดยอ้างถึง ความคิดเห็นนี้
Date : 2011-07-06 08:10:24 By : mamanakin
 

 

No. 3



โพสกระทู้ ( 36 )
บทความ ( 0 )



สถานะออฟไลน์


ต้องจาวาสคลิปคัวไหนหรอคับ พี่ช่วยทีนะคับ
แสดงความคิดเห็นโดยอ้างถึง ความคิดเห็นนี้
Date : 2011-07-07 15:43:32 By : mamanakin
 


 

No. 4



โพสกระทู้ ( 36 )
บทความ ( 0 )



สถานะออฟไลน์


สคลิปจาวาไม่ได้เลยหรอครับ แนะนำที่หาหน่อยคับ
แสดงความคิดเห็นโดยอ้างถึง ความคิดเห็นนี้
Date : 2011-07-11 13:27:24 By : mamanakin
 

   

ค้นหาข้อมูล


   
 

แสดงความคิดเห็น
Re : ช่วยเพิ่มเติมหน่อยครับ เลือก RadioButton ใน GridView โดยทำทีละ Row คือทำทีละข้อ กดข้อ1 แล้วข้อ2กดต่อได้
 
 
รายละเอียด
 
ตัวหนา ตัวเอียง ตัวขีดเส้นใต้ ตัวมีขีดกลาง| ตัวเรืองแสง ตัวมีเงา ตัวอักษรวิ่ง| จัดย่อหน้าอิสระ จัดย่อหน้าชิดซ้าย จัดย่อหน้ากึ่งกลาง จัดย่อหน้าชิดขวา| เส้นขวาง| ขนาดตัวอักษร แบบตัวอักษร
ใส่แฟลช ใส่รูป ใส่ไฮเปอร์ลิ้งค์ ใส่อีเมล์ ใส่ลิ้งค์ FTP| ใส่แถวของตาราง ใส่คอลัมน์ตาราง| ตัวยก ตัวห้อย ตัวพิมพ์ดีด| ใส่โค้ด ใส่การอ้างถึงคำพูด| ใส่ลีสต์
smiley for :lol: smiley for :ken: smiley for :D smiley for :) smiley for ;) smiley for :eek: smiley for :geek: smiley for :roll: smiley for :erm: smiley for :cool: smiley for :blank: smiley for :idea: smiley for :ehh: smiley for :aargh: smiley for :evil:
Insert PHP Code
Insert ASP Code
Insert VB.NET Code Insert C#.NET Code Insert JavaScript Code Insert C#.NET Code
Insert Java Code
Insert Android Code
Insert Objective-C Code
Insert XML Code
Insert SQL Code
Insert Code
เพื่อความเรียบร้อยของข้อความ ควรจัดรูปแบบให้พอดีกับขนาดของหน้าจอ เพื่อง่ายต่อการอ่านและสบายตา และตรวจสอบภาษาไทยให้ถูกต้อง

อัพโหลดแทรกรูปภาพ

Notice

เพื่อความปลอดภัยของเว็บบอร์ด ไม่อนุญาติให้แทรก แท็ก [img]....[/img] โดยการอัพโหลดไฟล์รูปจากที่อื่น เช่นเว็บไซต์ ฟรีอัพโหลดต่าง ๆ
อัพโหลดแทรกรูปภาพ ให้ใช้บริการอัพโหลดไฟล์ของไทยครีเอท และตัดรูปภาพให้พอดีกับสกรีน เพื่อความโหลดเร็วและไฟล์ไม่ถูกลบทิ้ง

   
  เพื่อความปลอดภัยและการตรวจสอบ กระทู้ที่แทรกไฟล์อัพโหลดไฟล์จากที่อื่น อาจจะถูกลบทิ้ง
 
โดย
อีเมล์
บวกค่าให้ถูก
<= ตัวเลขฮินดูอารบิก เช่น 123 (หรือล็อกอินเข้าระบบสมาชิกเพื่อไม่ต้องกรอก)







Exchange: นำเข้าสินค้าจากจีน, Taobao, เฟอร์นิเจอร์, ของพรีเมี่ยม, ร่ม, ปากกา, power bank, แฟลชไดร์ฟ, กระบอกน้ำ

Load balance : Server 03
ThaiCreate.Com Logo
© www.ThaiCreate.Com. 2003-2025 All Rights Reserved.
ไทยครีเอทบริการ จัดทำดูแลแก้ไข Web Application ทุกรูปแบบ (PHP, .Net Application, VB.Net, C#)
[Conditions Privacy Statement] ติดต่อโฆษณา 081-987-6107 อัตราราคา คลิกที่นี่