This is a migrated thread and some comments may be shown as answers.

Missing "New Row" Line

1 Answer 63 Views
GridView
This is a migrated thread and some comments may be shown as answers.
Karim
Top achievements
Rank 1
Karim asked on 15 May 2017, 09:19 AM

Hi,

I have integrated GridView in my application. This grid ist bound to a bindingsource. When my query for the binding source has no datas, then I missing the "new row" line for adding datas. Please see the attached files.

      If IsNumeric(RadGridView1.CurrentRow.Cells("ComboNr").Value) Then
        Dim iGruppeNr As Integer = grdParameter.CurrentRow.Cells("ComboNr").Value
        bsDetekParaCombo.DataSource = (From Combo As tblDetekParaCombo In dbContext.tblDetekParaCombo
                                       Order By Combo.ComboGruppeNr
                                       Where Combo.ComboGruppeNr = iGruppeNr Select Combo).ToList
      Else
        'Here I will get a count of 0 rows and I missing the new line for adding rows
        bsDetekParaCombo.DataSource = (From Combo As tblDetekParaCombo In dbContext.tblDetekParaCombo
                                       Order By Combo.ComboGruppeNr
                                       Where Combo.ComboGruppeNr = -1 Select Combo).ToList

        grdCombo.MasterTemplate.Refresh()
      End If

 

 

What I am doing wrong?

Karim

 

1 Answer, 1 is accepted

Sort by
0
Accepted
Hristo
Telerik team
answered on 15 May 2017, 11:08 AM
Hi Karim,

Thank you for writing.

The provided code snippet suggests that you might be binding to a collection of anonymous objects. In this case, the grid will not be editable as the collection data source object is read-only. The behavior of the grid is the same.

You can refer to the attached project mocking a similar setup. Please consider creating a strongly typed object. In case you need further assistance please provide me with more details about your actual setup.

I hope this helps. Should you have further questions please do not hesitate to write back.

Regards,
Hristo
Telerik by Progress
Try our brand new, jQuery-free Angular 2 components built from ground-up which deliver the business app essential building blocks - a grid component, data visualization (charts) and form elements.
Tags
GridView
Asked by
Karim
Top achievements
Rank 1
Answers by
Hristo
Telerik team
Share this question
or