Hi,
I am trying to retrieve data from a Rad Grid and inserting it into a dataset.
I am using the following code, but somehow it's not working. I would appreciate it if you could tell me how I should get it to work.
Imports System.Data.SqlClient
Imports System.Data
Protected Sub Button2_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles Button2.Click
Dim dt As DataTable = New System.Data.DataTable("Parameters")
Dim ds As New DataSet
Dim column As DataColumn
Dim row As DataRow
column = New DataColumn
column.DataType = System.Type.GetType("System.String")
column.ColumnName = "ParameterID"
column.Unique = True
dt.Columns.Add(column)
column = New DataColumn
column.DataType = System.Type.GetType("System.String")
column.ColumnName = "ParameterDesc"
column.Unique = True
dt.Columns.Add(column)
Dim PrimaryKeyColumns(0) As DataColumn
PrimaryKeyColumns(0) = dt.Columns("ParameterID")
dt.PrimaryKey = PrimaryKeyColumns
ds.Tables.Add(dt)
For Each Item In RadGrid1.MasterTableView.Items
row = dt.NewRow
row("ParameterID") = Item.Cells(0).Text
row("ParameterDesc") = Item.Cells(1).Text
dt.Rows.Add(row)
Next
End Sub

Hi
I'm trying to add text description and linkbuttons to the groupdheaderitem of a grid. I've added the controls in both ItemDataBound and ItemCreated grid events. As per the samples I'm using
DataRowView groupDataRow = e.Item.DataItem as DataRowView;
to access the data for the row, but this is not available on postback and I can't find another way to get the data for the row.
I can't access the DatakeyValues in ItemCommand events as the itemindex isn't set on the group header.
Is there another way to customize the contents of the group header to include buttons that will postback correctly and allow me to identify the data row for the event?
I'm using the latest version of the grid.
Thanks
Public
Sub rcLt_ItemsRequested(ByVal sender As Object, ByVal e As RadComboBoxItemsRequestedEventArgs)
Dim itemsList As String() = {"J", "G"}
Dim comboBox As RadComboBox = DirectCast(sender, RadComboBox)
comboBox.Items.Clear()
comboBox.DataSource = itemsList
comboBox.DataBind()
'How do I retrieve the value of the textbox from before I entered edit mode?
End Sub
If somebody could give me some guidanc on this that would be great!
Thanks
Private Sub GridViewControl_ItemCommand(ByVal source As Object, ByVal e As Telerik.Web.UI.GridCommandEventArgs) Handles GridViewControl.ItemCommand
If (e.CommandName = RadGrid.UpdateCommandName) Then
If (e.Item.GetType.ToString = "Telerik.Web.UI.GridEditFormItem") Then
Dim editedItem As GridEditFormItem = CType(e.Item, GridEditFormItem)
_Session(
"RadGrid.SavedOldValues") = editedItem.SavedOldValues
End If
End If
End Sub
Wilson