Hi,
I'm using the loop below to fill a GridDropDownColumn control with items from a customized LINQ query. That part works fine, so I did not include that code.
To finalize the query, I need to retrieve a value from one of the other cells (a GridDropDownColumn as well) in the same row. It's probably very simple, but I can't find how to get to that value. The HTML is listed below:
I want to retrieve the value of the column "Reseller". How can I do it?
I'm using the loop below to fill a GridDropDownColumn control with items from a customized LINQ query. That part works fine, so I did not include that code.
Private Sub RadGrid1_ItemDataBound(ByVal sender As Object, ByVal e As Telerik.Web.UI.GridItemEventArgs) Handles RadGrid1.ItemDataBound
If e.Item.IsInEditMode Then
For Each Column As GridColumn In e.Item.OwnerTableView.Columns
If Column.UniqueName = "ProductForReseller" Then
' Code goes here
End If
Next
End If
End Sub
To finalize the query, I need to retrieve a value from one of the other cells (a GridDropDownColumn as well) in the same row. It's probably very simple, but I can't find how to get to that value. The HTML is listed below:
<
telerik:RadGrid
ID
=
"RadGrid1"
runat
=
"server"
DataSourceID
=
"LinqDataSource1"
AllowFilteringByColumn
=
"True"
AllowPaging
=
"True"
AllowSorting
=
"True"
GridLines
=
"None"
Skin
=
"Outlook"
ShowGroupPanel
=
"True"
AllowAutomaticDeletes
=
"True"
AllowAutomaticInserts
=
"True"
AllowAutomaticUpdates
=
"True"
AutoGenerateColumns
=
"False"
Width
=
"62em"
Height
=
"37em"
>
<
ClientSettings
AllowDragToGroup
=
"True"
>
<
Scrolling
AllowScroll
=
"True"
/>
</
ClientSettings
>
<
MasterTableView
DataKeyNames
=
"reseller, product"
EditMode
=
"InPlace"
CommandItemDisplay
=
"Bottom"
DataSourceID
=
"LinqDataSource1"
>
<
SortExpressions
>
<
telerik:GridSortExpression
FieldName
=
"product"
SortOrder
=
"Ascending"
/>
</
SortExpressions
>
<
GroupByExpressions
>
<
telerik:GridGroupByExpression
>
<
SelectFields
>
<
telerik:GridGroupByField
FieldName
=
"reseller"
HeaderText
=
"Reseller"
/>
</
SelectFields
>
<
GroupByFields
>
<
telerik:GridGroupByField
FieldName
=
"reseller"
HeaderText
=
"Reseller"
/>
</
GroupByFields
>
</
telerik:GridGroupByExpression
>
</
GroupByExpressions
>
<
Columns
>
<
telerik:GridEditCommandColumn
EditText
=
"edit"
HeaderStyle-Width
=
"7em"
>
</
telerik:GridEditCommandColumn
>
<
telerik:GridDropDownColumn
UniqueName
=
"Reseller"
ListTextField
=
"name"
ListValueField
=
"id"
DataSourceID
=
"LinqDataSourceReseller"
HeaderText
=
"Reseller"
DataField
=
"reseller"
DropDownControlType
=
"RadComboBox"
AllowSorting
=
"true"
HeaderStyle-Width
=
"7em"
AllowFiltering
=
"false"
>
</
telerik:GridDropDownColumn
>
<
telerik:GridDropDownColumn
UniqueName
=
"ProductForReseller"
ListTextField
=
"name"
ListValueField
=
"id"
DataSourceID
=
"LinqDataSourceProduct"
HeaderText
=
"Product"
DataField
=
"product"
DropDownControlType
=
"RadComboBox"
AllowSorting
=
"true"
HeaderStyle-Width
=
"7em"
AllowFiltering
=
"false"
>
</
telerik:GridDropDownColumn
>
<
telerik:GridDropDownColumn
UniqueName
=
"ProductActivationType"
ListTextField
=
"name"
ListValueField
=
"id"
DataSourceID
=
"LinqDataSource2"
HeaderText
=
"Activation type"
DataField
=
"product_activation_type"
DropDownControlType
=
"RadComboBox"
AllowSorting
=
"true"
HeaderStyle-Width
=
"7em"
AllowFiltering
=
"false"
>
</
telerik:GridDropDownColumn
>
<
telerik:GridButtonColumn
CommandName
=
"Delete"
Text
=
"Delete"
UniqueName
=
"Delete"
HeaderStyle-Width
=
"7em"
>
</
telerik:GridButtonColumn
>
</
Columns
>
</
MasterTableView
>
</
telerik:RadGrid
>
I want to retrieve the value of the column "Reseller". How can I do it?