C1Grid custom

Posted by: marko_d on 10 September 2017, 11:41 am EST

  • Posted 10 September 2017, 11:41 am EST

    Hi,

    How to automatically add rows from code behind in C1GridView, this is my custom code for asp.net gridview in VB that works fine on button click event
    txtNumberRow.text = number of rows


    Dim RowNumber() As Integer = New Integer((Convert.ToInt32(txtNumberRow.text)) - 1) {}
    Dim i As Integer = 0
    Do While (i < RowNumber.Length)
    RowNumber(i) = (i + 1)
    i = (i + 1)
    Loop
    C1GridView.DataSource = RowNumber
    C1GridView.DataBind()




    c1gridview error:

    Value cannot be null.
    Parameter name: inputString


    Any suggestion?
    If this is not so clearly,i need a custom numbers of row where customer can enter data's
  • Replied 10 September 2017, 11:41 am EST

    Hi,

    please clarify which control you use, C1.Web.UI.Controls.C1GridView or C1.Web.Wijmo.C1GridView? Which version?

    Try binding grid to dynamically created DataTable instead of array:

    Dim dataTable As DataTable = New DataTable()

    dataTable.Columns.Add("COL")
    For i As Integer = 1 To dataLength
    dataTable.Rows.Add(i)
    Next

    C1GridView.DataSource = dataTable
    C1GridView.DataBind()
  • Replied 10 September 2017, 11:41 am EST

    Hi, thanks for replaying, but problem is resolved with existing code, i just added same code with different numbers of created rows, on page_load (number of created rows = 1) and button click event (number of created rows = txtNumberRow.text)
Need extra support?

Upgrade your support plan and get personal unlimited phone support with our customer engagement team

Learn More

Forum Channels