alim
Well-known member
When i selected cells in Datagridview.. you knw it will not give u the right order to work with so i tried
in coding
Every thing is right bt i m getting those value in diffrect order
I knw bcoz depend on the selection order .. can i do something to have the
index right order or i have to work with Rows.
plz guys help me....
in coding
Every thing is right bt i m getting those value in diffrect order
I knw bcoz depend on the selection order .. can i do something to have the
index right order or i have to work with Rows.
plz guys help me....
VB.NET:
Public Sub Paste_Rows_From_Excel_Grid(ByVal G As DataGridView, ByVal CopiedTxt As String)
Dim Ar As Array = Split(CStr(Trim(CopiedTxt)), vbCrLf)
For K As Integer = G.SelectedCells.Count - 1 To 0 Step -1
If Ar.Length - 1 >= K Then
If SoftIn.Get_DataType_NumberGrid(G, G.SelectedCells(K).ColumnIndex) = True Then'it will give me the datatype is 'num or not
G.SelectedCells(K).Value = Val(Ar(K))
ElseIf WGeT.ToLower = "datetime" Then 'wget will catch every datatype
If IsDate(Ar(K)) = True Then G.SelectedCells(K).Value = Dat2(Ar(K))
ElseIf WGeT.ToLower = "string" Then
G.SelectedCells(K).Value = ArV2(Ar, K)'its my function give me the array value
End If
End If
Next
End Sub
Last edited: