Hi Shivang,
I had the same issue with the grid. In hindsight, i would
have used another grid, given all the headaches and late
nights this one gave me. That said:
To make the columns not read-only:
I used TableStyles objects to initially set up my grid
column styles. This has a readonly property that i was
able to set to false. heres and example. This is done
before binding the grid.
~~~~~~~~~~~~~~~~~~~~~~~~~~~~
'Create the table style object
Dim TSModule As New DataGridTableStyle()
'create the column style objects
Dim TCSymbol As New DataGridTextBoxColumn()
TSModule.MappingName = TABLE_NAME
Me.dgModuleMaint.CaptionText = strModuleName
Me.dgModuleMaint.AllowSorting = True
Me.dgModuleMaint.RowHeaderWidth = 20
'Symbol Column
TCSymbol.MappingName = "security_symbol"
TCSymbol.HeaderText = "Ticker"
TCSymbol.Width = enuGridColumnWidth.symbol
TCSymbol.Alignment = HorizontalAlignment.Left
TCSymbol.ReadOnly = True
'Add this to the style object
TSModule.GridColumnStyles.Add(TCSymbol)
' Add the DataGridTableStyle instance to
' the GridTableStylesCollection.
Me.dgModuleMaint.TableStyles.Add(TSModule)
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Now to get rid of the ending append rows. This was a
solutions i found somewhere on the web. By default the
DataView can remove this row, so if you get to the
dataview you can remove it.
Code follows:
'USER_ this little section removes the Append Row from
' the end of the datagrid
Dim cm As CurrencyManager = Me.BindingContext
(Me.dgModuleMaint.DataSource, Me.dgModuleMaint.DataMember)
Dim dv As DataView = cm.List
dv.AllowNew = False
'End remove append Row
where dgModuleMaint is the datagrid object. I had this
code immediately following the databinding.
Hope this helps
Mike