Dim fname As String = ""
If (dlgImportClients.ShowDialog() = Windows.Forms.DialogResult.OK) Then
fname = dlgImportClients.FileName
End If
Dim TextLine As String = ""
Dim SplitLine() As String
If System.IO.File.Exists(fname) = True Then
Dim objReader As New System.IO.StreamReader(fname)
Do While objReader.Peek() <> -1
TextLine = objReader.ReadLine()
'need to add false for checkbox column
TextLine = "False," + TextLine
SplitLine = Split(TextLine, ",")
dgvClients.ColumnCount = SplitLine.Count
dgvClients.MasterGridViewTemplate.AllowAddNewRow = False
dgvClients.ReadOnly = False
dgvClients.Columns(0).IsVisible = True
'if .RowCount = 0 then we are processing the first row
If dgvClients.RowCount = 0 Then
For i = 1 To SplitLine.Count - 1
With dgvClients
.Columns(i).HeaderText = SplitLine(i).ToString
.Columns(i).BestFit()
End With
Next
End If
dgvClients.Rows.Add(SplitLine)
Loop
'stupid but the only way I could get the datagridview to populate correctly
If dgvClients.RowCount > 1 Then
dgvClients.Rows.RemoveAt(0)
End If
Else
RadMessageBox.SetThemeName("Breeze")
RadMessageBox.Show("File Does Not Exist")
End If
I am loading the .CSV file to the GridView so that it can be reviewed, cleaned up, and then imported into Clients table within the customers database.
I'm kinda stumped as to the best way to get the data in the GridView into the database. Could just be a brain fart or I may be going about this totally wrong. Any insight would be greatly appreciated.
I previously had Q3 2008 installed updated to Q1 2009 and now the save/load layout do not work. Actually the save works and creates the layout file but the load has no effect. Work fine before the update. Also noticed the demo only has a Save button, no Load button....
Can someone confirm that the load layout is broken or if I need to keep diggin..
| if (rgvAllItems.MasterGridViewTemplate.Columns.Count > 0) |
| { |
| Log.LogMessageToFileWarnings("Column count: " + rgvAllItems.MasterGridViewTemplate.Columns.Count); |
| try |
| { |
| while(rgvAllItems.MasterGridViewTemplate.Columns.Count > 0) |
| { |
| rgvAllItems.MasterGridViewTemplate.Columns.RemoveAt(0); |
| } |
| }catch(Exception ex) |
| { |
| Log.LogMessageToFileWarnings(String.Format("NetworkManager.cs -> clear telerik columns: {0}, {1}", ex.StackTrace, ex.Message)); |
| } |
| } |
| if (rgvAllItems.MasterGridViewTemplate.ChildGridViewTemplates.Count > 0) |
| { |
| try |
| { |
| while (rgvAllItems.MasterGridViewTemplate.ChildGridViewTemplates.Count > 0) |
| { |
| rgvAllItems.MasterGridViewTemplate.ChildGridViewTemplates.RemoveAt(0); |
| } |
| }catch (Exception ex) |
| { |
| Log.LogMessageToFileWarnings( |
| String.Format("NetworkManager.cs -> clear telerik ChildGridViewTemplates: {0}, {1}", |
| ex.StackTrace, ex.Message)); |
| } |
| } |
Hi
How do I clear previously created conditional formatting items from the ConditionalFormattingObject
Which were created using:
Dim con1 As ConditionalFormattingObject = New ConditionalFormattingObject("white rule", ConditionTypes.Contains, Me.RadTextBox1.Text.ToLower, Me.RadTextBox1.Text.ToLower, True)
c1.RowBackColor = Color.Green
RadGridView1.MasterGridViewTemplate.Columns.FindByDataField("Country").ConditionalFormattingObjectList.Add(c1)
Thanks
Joe