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,027

HOME > .NET Framework > Forum > แนะนำวิธี gridview1 แสดงแค่ 20 บรรทัดแรก 21-40 แสดงที่ gridview 2 แบบนี้ไปเรื่อยๆ database ตัวเดียวครับแต่แบ่ง gridview



 

แนะนำวิธี gridview1 แสดงแค่ 20 บรรทัดแรก 21-40 แสดงที่ gridview 2 แบบนี้ไปเรื่อยๆ database ตัวเดียวครับแต่แบ่ง gridview

 



Topic : 130199



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



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



แนะนำด้วยครับ
หฟกดฟหกดก



Tag : .NET, Win (Windows App), VB.NET







Move To Hilight (Stock) 
Send To Friend.Bookmark.
Date : 2018-02-05 16:57:10 By : sakkapong View : 796 Reply : 6
 

 

No. 1



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



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

เผื่อเป็นแนวทาง

Code (VB.NET)
 cmd = New MySql.Data.MySqlClient.MySqlCommand("SELECT fix_id,date_save,customer_id FROM comfix;", ConnectionDB)
        Call open_connection()
        Dr = cmd.ExecuteReader
        If Dr.HasRows Then
            While Dr.Read
                If Me.DataGridView1.RowCount < 20 Then
                    Dim r As Integer
                    r = Me.DataGridView1.RowCount
                    Me.DataGridView1.Rows.Add()
                    Me.DataGridView1.Rows(r).Cells(0).Value = Dr.Item("fix_id")
                    Me.DataGridView1.Rows(r).Cells(1).Value = Dr.Item("date_save")
                    Me.DataGridView1.Rows(r).Cells(2).Value = Dr.Item("customer_id")
                    If Me.DataGridView2.RowCount < 20 Then
                        Dim rr As Integer
                        rr = Me.DataGridView2.RowCount
                        Me.DataGridView2.Rows.Add()
                        Me.DataGridView2.Rows(rr).Cells(0).Value = Dr.Item("fix_id")
                        Me.DataGridView2.Rows(rr).Cells(1).Value = Dr.Item("date_save")
                        Me.DataGridView2.Rows(rr).Cells(2).Value = Dr.Item("customer_id")
                        If Me.DataGridView3.RowCount < 20 Then
                            Dim rrr As Integer
                            rrr = Me.DataGridView3.RowCount
                            Me.DataGridView3.Rows.Add()
                            Me.DataGridView3.Rows(rrr).Cells(0).Value = Dr.Item("fix_id")
                            Me.DataGridView3.Rows(rrr).Cells(1).Value = Dr.Item("date_save")
                            Me.DataGridView3.Rows(rrr).Cells(2).Value = Dr.Item("customer_id")
                            If Me.DataGridView4.RowCount <= 20 Then
                                Dim rrrr As Integer
                                rrrr = Me.DataGridView4.RowCount
                                Me.DataGridView4.Rows.Add()
                                Me.DataGridView4.Rows(rrrr).Cells(0).Value = Dr.Item("fix_id")
                                Me.DataGridView4.Rows(rrrr).Cells(1).Value = Dr.Item("date_save")
                                Me.DataGridView4.Rows(rrrr).Cells(2).Value = Dr.Item("customer_id")
                                If Me.DataGridView5.RowCount < 20 Then
                                    Dim rrrrr As Integer
                                    rrrrr = Me.DataGridView5.RowCount
                                    Me.DataGridView5.Rows.Add()
                                    Me.DataGridView5.Rows(rrrrr).Cells(0).Value = Dr.Item("fix_id")
                                    Me.DataGridView5.Rows(rrrrr).Cells(1).Value = Dr.Item("date_save")
                                    Me.DataGridView5.Rows(rrrrr).Cells(2).Value = Dr.Item("customer_id")
                                End If
                            End If
                        End If
                    End If
                End If
            End While
        End If







แสดงความคิดเห็นโดยอ้างถึง ความคิดเห็นนี้
Date : 2018-02-05 20:00:07 By : pakyaudio
 


 

No. 2



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



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


ตาม Link ด้านล่างครับ ผมเข้าใจว่าน่าจะ Paging นะ ถ้าไม้ถูกก็ Sorry ด้วยเด้อ
https://support.microsoft.com/en-us/help/305271/how-to-perform-paging-with-the-datagrid-windows-control-by-using-visua
แสดงความคิดเห็นโดยอ้างถึง ความคิดเห็นนี้
Date : 2018-02-06 08:26:09 By : Outhai
 

 

No. 3



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



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



แสดงความคิดเห็นโดยอ้างถึง ความคิดเห็นนี้
Date : 2018-02-06 08:27:33 By : outhai
 


 

No. 4



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



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

ไม่ใช่ Paging ครับ
1. 20 บรรทัดแรกให้อยู่ที่ GridView 1
2. 20 บรรทัดแรกให้อยู่ที่ GridView 2
3. 20 บรรทัดแรกให้อยู่ที่ GridView 3
4. 20 บรรทัดแรกให้อยู่ที่ GridView 4

ข้อมูลที่แสดงต้องไม่ซ้ำกัน แต่เอามาจาก database เดียวกันแบ่งกันอยู่ครับ
แสดงความคิดเห็นโดยอ้างถึง ความคิดเห็นนี้
Date : 2018-02-06 14:35:08 By : sakkapong
 


 

No. 5



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



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

ตอบความคิดเห็นที่ : 4 เขียนโดย : sakkapong เมื่อวันที่ 2018-02-06 14:35:08
รายละเอียดของการตอบ ::
แก้ไขครับ
1. 20 บรรทัดแรกให้อยู่ที่ GridView 1
2. 21-40 บรรทัดแรกให้อยู่ที่ GridView 2
3. 41-60 บรรทัดแรกให้อยู่ที่ GridView 3
4. 61-80 บรรทัดแรกให้อยู่ที่ GridView 4

* ข้อมูลที่ได้มาจากการ Query ใน sql ครับ


แสดงความคิดเห็นโดยอ้างถึง ความคิดเห็นนี้
Date : 2018-02-06 14:36:47 By : sakkapong
 


 

No. 6



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



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


คิดว่าน่าจะทำได้
โดยการ query ออกมาให้มีหมายเลขแถวด้วย
แล้วใช้ dataview เพื่อแยกข้อมูลออกมา
โดยใช้ filter ที่หมายเลขแถวเอาครับ
แสดงความคิดเห็นโดยอ้างถึง ความคิดเห็นนี้
Date : 2018-02-06 14:37:37 By : fonfire
 

   

ค้นหาข้อมูล


   
 

แสดงความคิดเห็น
Re : แนะนำวิธี gridview1 แสดงแค่ 20 บรรทัดแรก 21-40 แสดงที่ gridview 2 แบบนี้ไปเรื่อยๆ database ตัวเดียวครับแต่แบ่ง gridview
 
 
รายละเอียด
 
ตัวหนา ตัวเอียง ตัวขีดเส้นใต้ ตัวมีขีดกลาง| ตัวเรืองแสง ตัวมีเงา ตัวอักษรวิ่ง| จัดย่อหน้าอิสระ จัดย่อหน้าชิดซ้าย จัดย่อหน้ากึ่งกลาง จัดย่อหน้าชิดขวา| เส้นขวาง| ขนาดตัวอักษร แบบตัวอักษร
ใส่แฟลช ใส่รูป ใส่ไฮเปอร์ลิ้งค์ ใส่อีเมล์ ใส่ลิ้งค์ 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 04
ThaiCreate.Com Logo
© www.ThaiCreate.Com. 2003-2024 All Rights Reserved.
ไทยครีเอทบริการ จัดทำดูแลแก้ไข Web Application ทุกรูปแบบ (PHP, .Net Application, VB.Net, C#)
[Conditions Privacy Statement] ติดต่อโฆษณา 081-987-6107 อัตราราคา คลิกที่นี่