Hi,
I am trying to get a RadDropDownList to work within a RadGrid. Autogeneratecolumns are set to False and all columns have been set.
The first code snippet is the column I am having issues with. The second code snippet is the same column but doesn't offer the DropDownList feature.
Basically what I am trying to archive, is when a user is looking at the grid, they can easily change the "Team" without the need going to Edit > (Change record) > Update.
My issues I am facing are
How do I get the item to display the correct text as it just displays the first record from the data source. i.e. pull the data from the RadGrid datasource, the DataTextField should get the "Team" field. When I try to bind the data it just says "System.Data.DataRowView".
Once the user changes the value from the Drop Down List how do I retrieve that value in the code behind (VB.net but C# is fine), I cannot find anything relating to CommandName?
Thanks,
Alex
I am trying to get a RadDropDownList to work within a RadGrid. Autogeneratecolumns are set to False and all columns have been set.
The first code snippet is the column I am having issues with. The second code snippet is the same column but doesn't offer the DropDownList feature.
Basically what I am trying to archive, is when a user is looking at the grid, they can easily change the "Team" without the need going to Edit > (Change record) > Update.
<
telerik:GridTemplateColumn
> <
ItemTemplate
> <
telerik:RadDropDownList
DataField
=
"IDNO"
DataSourceID
=
"TeamFilterOptions"
HeaderText
=
"123"
DataTextField
=
"FieldAnswer"
UniqueName
=
"DocCategoryColumn3"
runat
=
"server"
ID
=
"ddlEditCategory"
AutoPostBack
=
"True"
></
telerik:RadDropDownList
> </
ItemTemplate
> </
telerik:GridTemplateColumn
>
<
telerik:GridBoundColumn
DataField
=
"Team"
HeaderText
=
"Team"
UniqueName
=
"Team"
> <
FilterTemplate
> <
telerik:RadComboBox
ID
=
"RadListBoxTeam"
DataSourceID
=
"TeamFilterOptions"
DataTextField
=
"FieldAnswer"
DataValueField
=
"FieldAnswer"
Height
=
"200px"
AppendDataBoundItems
=
"true"
SelectedValue='<%# TryCast(Container,GridItem).OwnerTableView.GetColumn("Team").CurrentFilterValue %>' runat="server" OnClientSelectedIndexChanged="TeamIndexChange"> <
Items
> <
telerik:RadComboBoxItem
Text
=
"All"
/> </
Items
> </
telerik:RadComboBox
> <
telerik:RadScriptBlock
ID
=
"RadScriptBlock1"
runat
=
"server"
> <
script
type
=
"text/javascript"
> function TeamIndexChange(sender, args) { var tableView = $find("<%# TryCast(Container, GridItem).OwnerTableView.ClientID%>"); tableView.filter("Team", args.get_item().get_value(), "EqualTo"); } </
script
> </
telerik:RadScriptBlock
> </
FilterTemplate
> </
telerik:GridBoundColumn
>
My issues I am facing are
How do I get the item to display the correct text as it just displays the first record from the data source. i.e. pull the data from the RadGrid datasource, the DataTextField should get the "Team" field. When I try to bind the data it just says "System.Data.DataRowView".
Once the user changes the value from the Drop Down List how do I retrieve that value in the code behind (VB.net but C# is fine), I cannot find anything relating to CommandName?
Thanks,
Alex