Home - Forums-.NET - FlyGrid.Net (Windows Forms) - String field shows dropdown...

FlyGrid.Net (Windows Forms)

.NET Datagrid - Fast, highly customizable, industry standards .NET data grid control for WinForms

This forum related to following products: FlyGrid.Net

String field shows dropdown...
Link Posted: 27-Oct-2005 03:21
I have a flygrid that has a DynamicallyAutoDetectDataTypeColumn column which has various types of field dropdown, datetime etc. The problem is that when I specify a text field and I click on the field to edit it , it shows the dropdown arrow on the field. How can I get ride of that???

The code I am using to specify the text field is:


CType("", String)


Thanks in advance

Simon
Link Posted: 28-Oct-2005 01:16
Try to use System.String.Emtpy instead of CTYpe("", string);
Link Posted: 31-Oct-2005 10:27
Even with using:


System.String.Empty


It still displays a dropdown arrow. I am using a DynamicallyAutoDetectDataTypeColumn column if that makes a difference??

Thank you

Simon
Link Posted: 31-Oct-2005 10:57
Could you provide me a sample to quickly solve this problem?
Please send a sample to develop (at) 9rays.net
Link Posted: 01-Nov-2005 10:21
I guess flygrid does not like my code for some reason, but I am unsure of why??

If I used the following code it works fine:


            Do While myReader.Read
                attCode = myReader.Item("shortCode")
                attDesc = myReader.Item("description")
                attIso = myReader.Item("addedToIso")
                attPipe = myReader.Item("addedToPipe")
                attName = myReader.Item("name")
                attType = myReader.Item("type")

                Dim data As Object()
                If myReader.Item("type") = "Text" Then
                    data = New Object() {attCode, attDesc, attIso, attPipe, attName, ""}
                    Me.lstNameProp.Rows.Items.Add(New Node(data))
                Endif
            Loop


But the code I want to use is below. The reason why I have done this is because the user can customise and add their own attributes / fields to my flygrid. So I therefore determine what type of field they are and do the relavent code. How ever it seems to alway put the dropdown arrow next to every field. I obviously am doing something wrong.


            Do While myReader.Read
                attCode = myReader.Item("shortCode")
                attDesc = myReader.Item("description")
                attIso = myReader.Item("addedToIso")
                attPipe = myReader.Item("addedToPipe")
                attName = myReader.Item("name")
                attType = myReader.Item("type")

                Dim data As Object()
                If myReader.Item("type") = "Text" Then
                    data = New Object() {attCode, attDesc, attIso, attPipe, attName, ""}
                ElseIf myReader.Item("type") = "Drop Down" Then
                    data = New Object() {attCode, attDesc, attIso, attPipe, attName, myYesNo.No}
                ElseIf myReader.Item("type") = "Date" Then
                    data = New Object() {attCode, attDesc, attIso, attPipe, attName, New DateTime}
                End If

                Me.lstNameProp.Rows.Items.Add(New Node(data))
            Loop


Note: The attCode,attDesc,attIso,attPipe,attName are all string variables and are being placed in text columns. The last column is an DynamicallyAutoDetectDataTypeColumn.

Thank you in advance

Simon
Link Posted: 02-Nov-2005 04:21
Please provide me with FlyGrid columns initializaton, problem in this method.
I've tried to add into vertical grid sample node with string (you can try to replace code in the Vertical Grid sample with following code) and haven't found incorrectness:

    Private Sub FillGrid()
      vertGrid.Columns.Items.Clear()
      vertGrid.Columns.Items.AddRange( _
        New Column() { _
          New Column("Name"), _
          New DynamicallyAutoDetectDataTypeColumn("Value") _
        } _
      )
      vertGrid.Columns.Items(0).Width = vertGrid.Width / 2
      vertGrid.Columns.Items(0).ReadOnly = True
      vertGrid.Columns.Items(0).CellBackColor = Color.FromArgb(246, 246, 244)
      vertGrid.Columns.Items(1).Width = (vertGrid.Width / 2) - 8
      AddHandler CType(vertGrid.Columns.Items(1), DynamicallyAutoDetectDataTypeColumn).GetDataType, AddressOf Me.vertGridColumn_GetDataType
      vertGrid.Options = vertGrid.Options Or GridOptions.RowSelect
      vertGrid.Rows.DataSource = New Object() { _
          New Object() {"Color", Color.Transparent}, _
          New Object() {"ContentAlignment", ContentAlignment.MiddleCenter}, _
          New Object() {"DateTime", Date.Now}, _
          New Object() {"Icon", MyBase.Icon.Clone}, _
          New Object() {"Font", MyBase.Font.Clone}, _
          New Object() {"BorderStyle", vertGrid.BorderStyle}, _
          New Object() {"Options", vertGrid.Options}, _
          New Object() {"Dock", MyBase.Dock}, _
          New Object() {"Anchor", MyBase.Anchor}, _
          'here is string type data ->>>>
          New Object() {"Name", MyBase.Name}, _
          New Object() {"Cursor", MyBase.Cursor}, _
          New Object() {"CustomData(Yes or No)", MyYesNo.Yes}, _
          New Object() {"CustomData(FileName based)", New FileNameBasedData(Me.GetType().Assembly.Location)}, _
          New Object() {"Image Preview", pokemonsList.Images(2), GetType(System.Drawing.Image)} _
      }
    End Sub