hi,
how can i add text to a command button in a radgridview row?
AddHandler RadGridDocuments.CommandCellClick, AddressOf RadGridDocuments_CommandCellClick
Dim commandColumn As GridViewCommandColumn = New GridViewCommandColumn()
commandColumn.HeaderText = "Command"
commandColumn.Width = 100
commandColumn.DataField = "PersonID"
Me.RadGridDocuments.Columns.Add(commandColumn)
thanks, andreas
5 Answers, 1 is accepted
0
andi
Top achievements
Rank 1
answered on 29 Jan 2008, 12:10 PM
...or is ist only possible to display the content of the .DataField property?
thanks, andreas
thanks, andreas
0
Hello Andreas,
Yes, it is possible to display the content of a DataField inside the command button. You can do this in the CellFormatting event handler. Consider the following code snippet:
Let us know if you have further questions.
Cheers,
Jack
the Telerik team
Instantly find answers to your questions at the new Telerik Support Center
Yes, it is possible to display the content of a DataField inside the command button. You can do this in the CellFormatting event handler. Consider the following code snippet:
Private Sub radGridView1_CellFormatting(ByVal sender As Object, ByVal e As CellFormattingEventArgs) |
Dim column As GridViewDataColumn = TryCast(e.CellElement.ColumnInfo, GridViewDataColumn) |
If TypeOf e.CellElement.ColumnInfo Is GridViewCommandColumn AndAlso column.DataField = "Action" Then |
Dim button As RadButtonElement = TryCast(e.CellElement.Children(0), RadButtonElement) |
button.Text = column.DataField |
End If |
End Sub |
Let us know if you have further questions.
Cheers,
Jack
the Telerik team
Instantly find answers to your questions at the new Telerik Support Center
0
Nicolaï
Top achievements
Rank 2
answered on 21 Feb 2011, 10:27 AM
DataField is not a member of Telerik.WinControls.UI.GridViewDataColumn ?!
0
Richard Slade
Top achievements
Rank 2
answered on 21 Feb 2011, 10:35 AM
Hello Nicolai,
The original answers in this thread are quite old now. For up to date information on the GridViewCommandColumn, please see the documentation on this column type that can be found here.
I hope you find this helpful but let me know if you need more information
Richard
The original answers in this thread are quite old now. For up to date information on the GridViewCommandColumn, please see the documentation on this column type that can be found here.
I hope you find this helpful but let me know if you need more information
Richard
0
Nicolaï
Top achievements
Rank 2
answered on 21 Feb 2011, 11:38 AM
Hello,
thanks Richard, found what I needed there!
Best regards,
Nicolaï
thanks Richard, found what I needed there!
Best regards,
Nicolaï