Eric
  • Eric
  • Member Topic Starter
2014-12-19T01:21:53Z
HI everyone, I am new to the forum and new to iGrid. I have been playing around with iGrid for the last couple of days and my first impressions are that iGrid is Awesome! I am used to populating my previous listviews with Sqldatareader (unbound) so that is how I am populating my igrids. All seems to work well and is much faster than the .Net Listview. I can populate 5000 records in about the same time it takes a listview to populate 500 so i am very happy with that. I am setting my rowmode to true, and for each cell I am using the readonly property to disable editing of all cells. I will be using an elipsis button to get the row key (which is my ID column duplicated) to perform any Sql updates I need to do based on that ID. It seems that the true/false of the readonly property is backwards. I set the cell(j,k).read only = true and I can edit cells. I set cell(j,k).readonly = false and it disables editing. Am I missing something and am I even doing this the right way?

Thanks,
Eric
Igor/10Tec
2014-12-19T17:37:11Z
The ellipsis button is considered a tool one can use to edit a cell. That's why it is disabled if you set the cell's ReadOnly property to True.

You need to disable just the text editing feature of the cell, and it is done with the help of the RequestEdit event. Here is the corresponding excerpt from the help file, from the iGCell.ReadOnly Property topic:

Quote:

Note that this property affects the cell ellipsis buttons. If you want to make ellipsis buttons clickable but prohibit the editing of cell value, you should handle the RequestEdit event and set its DoDefault argument to False.

Eric
  • Eric
  • Member Topic Starter
2014-12-19T18:50:47Z
Thank you for your response. I will give the RequestEdit event a try. One thing that I didnt't clarify before is that I am only using 1 elipsis button for the entire row and it's in its own column (at the leftmost column of the row). For this application I am not doing eny editing directly from the grid. Even if I don't use elipsis buttons it seems to be working opposite of what I would expect. Here is the code I was trying where the outcome seemed backwards:


        Dim currentigrid As TenTec.Windows.iGridLib.iGrid
        currentigrid = IGRID_TEST_FORM.IGrid1
        currentigrid.Cols.Clear()
        currentigrid.Rows.Clear()
        currentigrid.RowMode = True

        'Adds Each column from my string array
        Dim j As Integer = 0
        For Each Str As String In FIELD
            currentigrid.Cols.Add(Str)
            currentigrid.Cols(j).Key = Str
            currentigrid.Cols(j).ColHdrStyle.Font = New Font(currentigrid.Font, FontStyle.Bold)
            j += 1
        Next

        currentigrid.Refresh()
        SQL_connect(MyDBName)
        strsql = Full_SQL
        sqlcmd.CommandText = strsql
        sqlcmd.Connection = sqlconn
        sqldr = sqlcmd.ExecuteReader
        Resultvar = ""

        'Adds each row from Sqldr and populates each cell in row
        Dim z As Integer = 0
        Dim i As Integer = 0
        While sqldr.Read()
            currentigrid.Rows.Add()
            currentigrid.Rows(i).Key = sqldr(FIELD(0))
            z = 0
            For Each Str As String In FIELD
                currentigrid.Cells(i, z).Value = IIf(IsDBNull(sqldr(Str)), NullSpecial, sqldr(Str))
                '***'If I set this to true- Editing is Enabled. If I set this to false- Editing is disabled'***
                currentigrid.Cells(i, z).ReadOnly = False
                z += 1
            Next
            i += 1
        End While
        SQL_Close()

Also, as far as the documentation are you refering to the manual from 9-25-14? I just want to make sure i have all available documentation.

Thanks for all of your help
Eric
Eric
  • Eric
  • Member Topic Starter
2014-12-19T19:25:57Z
So.. it works as expected when I set the property to iGBool.True/iGBool.false as opposed to just True/False. Let me know if that is expected.

Thanks Again
Eric
Igor/10Tec
2014-12-20T08:39:19Z
Yes, you are using the latest version of the documentation.

And yes, you need to assign an iGBool value to iGCell.ReadOnly property as it has the iGBool type, not Boolean. The reason why this property has the iGBool type is that the iGBool enum has a special iGBool.NotSet value, which means this setting is inherited from the column cell style or the whole grid.

currentigrid.Cells(i, z).ReadOnly = False

In fact, this line should not be compiled, and the VB compiler should display an error - but this does not happen if your Option Strict option is set to 'Off'. I would recommend that you always set it to 'On' to avoid such issues. Unfortunately, this option is set to 'Off' after the installation of VS. Read this for more info:

http://support.microsoft.com/kb/311329