<
telerik:RadBinaryImage
ID
=
"imageThumbnail"
runat
=
"server"
DataValue='<%# Eval("imageThumbData") %>' ImageUrl="~/imageLibrary/common/nopic.gif" Width="125" Height="125" />
<
add
key
=
"Telerik.EnableEmbeddedSkins"
value
=
"false"
/>
<
add
key
=
"Telerik.EnableEmbeddedBaseStylesheet"
value
=
"false"
/>
<
Columns>
<telerik:GridBoundColumn DataField="ID" DataType="System.Int32" HeaderText="ID" UniqueName="ID">
</telerik:GridBoundColumn>
<telerik:GridBoundColumn DataField="Division.DivisionName" HeaderText="DivisionName">
</telerik:GridBoundColumn>
<telerik:GridBoundColumn DataField="LocationID" HeaderText="LocationID">
</telerik:GridBoundColumn>
</Columns>
<EditItemTemplate>
<telerik:RadComboBox DataTextField="Division.DivisionName" DataField="Division.DivisionName" ID="ddlDivisionName" runat="server" >
</telerik:RadComboBox>
<telerik:RadComboBox DataTextField="Location.LocationName" DataField="Location.LocationName" ID="ddlLocationName" runat="server" >
</telerik:RadComboBox>
</EditItemTemplate>
Thanks!
<telerik:RadGrid ID=
"radGridCompProdKeywords"
GridLines=
"None"
runat=
"server"
AllowAutomaticDeletes=
"True"
AllowAutomaticInserts=
"True"
PageSize=
"10"
AllowAutomaticUpdates=
"True"
AllowPaging=
"false"
AutoGenerateColumns=
"False"
OnUpdateCommand=
"radGridCompProdKeywords_ItemUpdated"
OnNeedDataSource=
"radGridCompProdKeywords_NeedDataSource"
OnDeleteCommand=
"radGridCompProdKeywords_ItemDeleted"
OnInsertCommand=
"radGridCompProdKeywords_ItemInserted"
Width=
"650px"
OnItemDataBound=
"radGridCompProdKeywords_ItemDataBound"
>
<MasterTableView EditMode=
"InPlace"
Width=
"100%"
CommandItemDisplay=
"Top"
DataKeyNames=
""
HorizontalAlign=
"NotSet"
AutoGenerateColumns=
"False"
>
<Columns>
<telerik:GridEditCommandColumn ButtonType=
"ImageButton"
UniqueName=
"EditCommandColumn"
> <ItemStyle CssClass=
"MyImageButton"
/>
</telerik:GridEditCommandColumn>
<telerik:GridBoundColumn DataField=
"CompProdKeywordId"
HeaderText=
"CompProdKeywordId"
SortExpression=
"CompProdKeywordId"
UniqueName=
"columnCompProdKeywordId"
ColumnEditorID=
"GridTextBoxCompProdKeywordId"
Visible=
"false"
>
</telerik:GridBoundColumn>
<telerik:GridBoundColumn DataField=
"CompProductId"
HeaderText=
"ProductId"
SortExpression=
"ProductId"
UniqueName=
"CompProductId"
ColumnEditorID=
"GridTextBoxCompProductId"
Visible=
"false"
>
</telerik:GridBoundColumn>
<telerik:GridDropDownColumn DataField=
"ProductName"
HeaderText=
"Company Product Name"
ListTextField=
"ProductName"
ListValueField=
"CompProductId"
UniqueName=
"columnCompProductName"
ColumnEditorID=
"GridDropDownColumnCompProdName"
ListDataMember=
"ProductName"
>
</telerik:GridDropDownColumn>
<telerik:GridBoundColumn DataField=
"CompProdKeywordName"
HeaderText=
"Keyword"
SortExpression=
"CompProdKeywordName"
UniqueName=
"columnCompProdKeywordName"
ColumnEditorID=
"GridTextBoxCompProdKeywordName"
>
</telerik:GridBoundColumn>
<telerik:GridButtonColumn ConfirmText=
"Delete this product?"
ConfirmDialogType=
"RadWindow"
ConfirmTitle=
"Delete"
ButtonType=
"ImageButton"
CommandName=
"Delete"
Text=
"Delete"
UniqueName=
"DeleteColumn"
>
<ItemStyle HorizontalAlign=
"Center"
CssClass=
"MyImageButton"
/>
</telerik:GridButtonColumn>
</Columns>
</MasterTableView>
<ClientSettings>
<ClientEvents OnRowDblClick=
"RowDblClick"
/> </ClientSettings>
</telerik:RadGrid>
Hi,
We are trying to change the color of the filterItem when there is a filter in
the grid(dynamicaly created). It all seems to work fine but when one of the
grid columns is filtered with the "Is Empty" function the color does not apply.
The code works fine and if a column is using a filterTemplate this column has
the color applied correctly but the color is ignored by the other columns.
Here is the code that we use to make the filterItem change color when filter is applied :
using
System;
using
System.Collections;
using
System.IO;
using
System.Web.UI;
using
CommonTools;
using
Telerik.Web.UI;
namespace
CCO.Fortress.MainWebApplication.Library.Helpers
{
private
void
OnPageLoadComplete(
object
sender, EventArgs e)
{
FortressGrid.MasterTableView.AllowMultiColumnSorting =
true
;
GridItem[] gridFilteringItems = FortressGrid.MasterTableView.GetItems(GridItemType.FilteringItem);
if
(gridFilteringItems.Length > 0)
{
GridFilteringItem filteringItem = (GridFilteringItem)gridFilteringItems[0];
foreach
(GridColumn column
in
FortressGrid.MasterTableView.Columns)
{
if
(column.CurrentFilterValue !=
string
.Empty)
{
Control control = filteringItem[column.UniqueName].Controls[0];
if
(control
is
WebControl)
{
((WebControl)control).BackColor = Color.PaleTurquoise;
}
}
}
}
}
}