I have a template column in a grid as follows trying to populate all the sources and set the focus on particular source...
but i was able to get only the focused value...and combo-box is not populating...how to achieve all the values and set focus on particular value
<
telerik:GridTemplateColumn
HeaderText
=
"Source"
DataField
=
"SourceName"
>
<
ItemTemplate
>
<%# DataBinder.Eval(Container.DataItem, "SourceName")%>
</
ItemTemplate
>
<
EditItemTemplate
>
<
telerik:RadComboBox
ID
=
"rdcmbSource1"
runat
=
"server"
Height
=
"200px"
Width
=
"190px"
DataTextField
=
"SourceName"
DataValueField
=
"SourceID"
DataSource="<%# GetActivemarketingSources() %>"
SelectedValue='<%# Eval("SourceID").ToString() %>'>
</
telerik:RadComboBox
>
</
EditItemTemplate
>
</
telerik:GridTemplateColumn
>
public
static
object
GetActivemarketingSources()
{
using
(EnabledDataContext db =
new
EnabledDataContext())
{
var getsources = (from sources
in
db.Sources
where sources.StoreID.Equals(535) && !sources.Deleted
orderby sources.SourceID
select
new
{
SourceID = sources.SourceID.ToString(),
SourceName = sources.SourceName.ToString()
}).ToList();
getsources.Insert(0,
new
{ SourceID =
""
, SourceName =
""
});
getsources.Insert(1,
new
{ SourceID =
""
, SourceName =
"Selected by user"
});
return
getsources;
}
}
Thanks...!!