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

default values for new row

2 Answers 333 Views
GridView
This is a migrated thread and some comments may be shown as answers.
Tomer
Top achievements
Rank 1
Tomer asked on 17 Jan 2011, 08:48 PM
Hello my friends,

Is there a nice way for letting the user to set default values for some of the columns for new row? (when adding new row it will contains the default values (template row or something like this))

Another little question: can you tell me where i can find winforms grid view advanced demos? most of the demos i saw in the telerik tv are in high level.

Thank you very much!
Tomer

2 Answers, 1 is accepted

Sort by
0
Accepted
Richard Slade
Top achievements
Rank 2
answered on 18 Jan 2011, 12:52 AM
Hello,

One way to do this is to capture the UserAddingRow event and check the value of what is being added.
For exmaple
Private Sub RadGridView1_UserAddingRow(ByVal sender As System.Object, ByVal e As Telerik.WinControls.UI.GridViewRowCancelEventArgs) Handles RadGridView1.UserAddingRow
    For Each row As GridViewRowInfo In e.Rows
        If row.Cells("Name").Value Is Nothing Then
            row.Cells("Name").Value = "Default"
        End If
    Next
End Sub

Hope that helps but let me know if you need more information
Richard
0
Accepted
Richard Slade
Top achievements
Rank 2
answered on 18 Jan 2011, 12:53 AM
In addition, for further demos, have a look at the Telerik demos that were installed on your PC with the RadControls. There is a comprehensive set and source code is available.
If you are after something very specific, please let me know and I'll try and help
Richard
Tags
GridView
Asked by
Tomer
Top achievements
Rank 1
Answers by
Richard Slade
Top achievements
Rank 2
Share this question
or