<
telerik:RadGrid
ID
=
"gridSurveys"
runat
=
"server"
AutoGenerateDeleteColumn
=
"True"
AllowAutomaticInserts
=
"True"
AutoGenerateEditColumn
=
"True"
OnNeedDataSource
=
"gridSurveys_NeedDataSource"
OnItemDataBound
=
"gridSurveys_ItemDataBound"
AutoGenerateColumns
=
"False"
CellSpacing
=
"-1"
GridLines
=
"Both"
>
<
MasterTableView
>
<
Columns
>
<
telerik:GridBoundColumn
DataField
=
"VesselDescription"
HeaderText
=
"Vessel"
UniqueName
=
"VesselDescription"
ReadOnly
=
"true"
></
telerik:GridBoundColumn
>
<
telerik:GridBoundColumn
DataField
=
"VesselID"
DataType
=
"System.Int32"
FilterControlAltText
=
"Filter VesselID column"
HeaderText
=
"VesselID"
SortExpression
=
"VesselID"
UniqueName
=
"VesselID"
Visible
=
"false"
ReadOnly
=
"True"
></
telerik:GridBoundColumn
>
<
telerik:GridBoundColumn
DataField
=
"CruiseID"
DataType
=
"System.Int32"
FilterControlAltText
=
"Filter CruiseID column"
HeaderText
=
"Cruise"
SortExpression
=
"CruiseID"
UniqueName
=
"CruiseID"
ReadOnly
=
"True"
></
telerik:GridBoundColumn
>
<
telerik:GridBoundColumn
DataField
=
"Year"
DataType
=
"System.Int32"
FilterControlAltText
=
"Filter Year column"
HeaderText
=
"Year"
ReadOnly
=
"True"
SortExpression
=
"Year"
UniqueName
=
"Year"
></
telerik:GridBoundColumn
>
<
telerik:GridBoundColumn
DataField
=
"Amalgamation"
HeaderText
=
"Amalgamation"
ReadOnly
=
"True"
UniqueName
=
"Amalgamation"
Visible
=
"false"
></
telerik:GridBoundColumn
>
<
telerik:GridDropDownColumn
DataField
=
"TargetSurveyDescription"
HeaderText
=
"Target Survey"
ListTextField
=
"TargetSurveyDescription"
ListValueField
=
"TargetSurveyID"
UniqueName
=
"TargetSurveyDescription"
ColumnEditorID
=
"TargetSurveyDescription"
DropDownControlType
=
"DropDownList"
Visible
=
"false"
></
telerik:GridDropDownColumn
>
<
telerik:GridBoundColumn
DataField
=
"TargetSurveyID"
DataType
=
"System.Int32"
HeaderText
=
"TargetSurveyID"
UniqueName
=
"TargetSurveyID"
ReadOnly
=
"true"
Visible
=
"false"
>
</
telerik:GridBoundColumn
>
</
Columns
>
</
MasterTableView
>
</
telerik:RadGrid
>
Protected
Sub
gridSurveys_ItemDataBound(sender
As
Object
, e
As
GridItemEventArgs)
Handles
gridSurveys.ItemDataBound
' Build up the Target Survey dropdown
Dim
editItemTargetSurvey
As
GridEditableItem =
DirectCast
(e.Item, GridEditableItem)
Dim
editManagerTargetSurvey
As
GridEditManager = editItemTargetSurvey.EditManager
Dim
editorTargetSurvey
As
GridDropDownListColumnEditor =
DirectCast
(editManagerTargetSurvey.GetColumnEditor(
"TargetSurveyDescription"
), GridDropDownListColumnEditor)
Dim
dsTargetSurvey
As
New
DSSurveyTableAdapters.spGetTargetSurveyTableAdapter
Dim
selectedTargetSurvey
As
Integer
= DataBinder.Eval(editItemTargetSurvey.DataItem,
"TargetSurveyID"
)
Dim
rComboBoxTargetSurvey
As
DropDownList = editorTargetSurvey.DropDownListControl
' Set the width of the dropdown
rComboBoxTargetSurvey.Width = Unit.Pixel(165)
' Populate the dropdown
rComboBoxTargetSurvey.DataTextField =
"TargetSurveyDescription"
rComboBoxTargetSurvey.DataValueField =
"TargetSurveyID"
rComboBoxTargetSurvey.DataBind()
rComboBoxTargetSurvey.SelectedValue = selectedTargetSurvey
End
Sub
<
telerik:RadToolBarSplitButton
runat
=
"server"
Value
=
"textColor"
>
<
Buttons
>
<
telerik:RadToolBarButton
runat
=
"server"
Text
=
"Black"
Value
=
"#text#000000"
ImageUrl
=
"Images/Navvia/standard_color_black_16x16.png"
>
</
telerik:RadToolBarButton
>
<
telerik:RadToolBarButton
runat
=
"server"
Text
=
"White"
Value
=
"#text#ffffff"
ImageUrl
=
"Images/Navvia/standard_color_white_16x16.png"
>
</
telerik:RadToolBarButton
>
<
telerik:RadToolBarButton
runat
=
"server"
Text
=
"Dark Red"
Value
=
"#text#cc0000"
ImageUrl
=
"Images/Navvia/standard_color_dark_red_16x16.png"
>
</
telerik:RadToolBarButton
>
<
telerik:RadToolBarButton
runat
=
"server"
Text
=
"Red"
Value
=
"#text#ff0000"
ImageUrl
=
"Images/Navvia/standard_color_red_16x16.png"
>
</
telerik:RadToolBarButton
>
<
telerik:RadToolBarButton
runat
=
"server"
Text
=
"Orange"
Value
=
"#text#ffcc00"
ImageUrl
=
"Images/Navvia/standard_color_orange_16x16.png"
>
</
telerik:RadToolBarButton
>
<
telerik:RadToolBarButton
runat
=
"server"
Text
=
"Yellow"
Value
=
"#text#ffff00"
ImageUrl
=
"Images/Navvia/standard_color_yellow_16x16.png"
>
</
telerik:RadToolBarButton
>
<
telerik:RadToolBarButton
runat
=
"server"
Text
=
"Light Green"
Value
=
"#text#99cc66"
ImageUrl
=
"Images/Navvia/standard_color_light_green_16x16.png"
>
</
telerik:RadToolBarButton
>
<
telerik:RadToolBarButton
runat
=
"server"
Text
=
"Green"
Value
=
"#text#009966"
ImageUrl
=
"Images/Navvia/standard_color_green_16x16.png"
>
</
telerik:RadToolBarButton
>
<
telerik:RadToolBarButton
runat
=
"server"
Text
=
"Light Blue"
Value
=
"#text#0099ff"
ImageUrl
=
"Images/Navvia/standard_color_light_blue_16x16.png"
>
</
telerik:RadToolBarButton
>
<
telerik:RadToolBarButton
runat
=
"server"
Text
=
"Blue"
Value
=
"#text#0066cc"
ImageUrl
=
"Images/Navvia/standard_color_blue_16x16.png"
>
</
telerik:RadToolBarButton
>
<
telerik:RadToolBarButton
runat
=
"server"
Text
=
"Dark Blue"
Value
=
"#text#003366"
ImageUrl
=
"Images/Navvia/standard_color_dark_blue_16x16.png"
>
</
telerik:RadToolBarButton
>
<
telerik:RadToolBarButton
runat
=
"server"
Text
=
"Purple"
Value
=
"#text#663399"
ImageUrl
=
"Images/Navvia/standard_color_purple_16x16.png"
>
</
telerik:RadToolBarButton
>
</
Buttons
>
</
telerik:RadToolBarSplitButton
>
var
toolBar = $find(
"<%=RadToolBar1.ClientID%>"
);
var
textColorButton = toolBar.get_items().getItem(16);
textColorButton.set_imageUrl(
'Images/Navvia/text_color_16x16.png'
);
I have a radgrid that has Hide/Unhide feature via theContextMenu, basically I have EnableHeaderContextMenu="true".When I right click on the Header bar the RadMenu is shown with all myColumns. I can check/uncheck and the column appears and disappears respectively. Also I have about 20 columns therefore I havea horizontal scrollbar. Finally I have a frozen column, say column 3 (Store Name).
The problem is when I hide column 4 (called Region) and move the scrollbar to the nextcolumn called Status (District will scrolloff the Grid which is GREAT) and scroll back left, than the District column is lost or notdisplayed. If I click the next page button it will reappear but as soon as Imove the scrollbar to right to the next column (Status) and back than theDistrict is lost.
Note: These are some of the column names
Detail, Store, Store Name, Region, District, Status
Just take the Frozen column online live demo and set EnableHeaderContextMenu="true" in the MasterTableView smart tag and hide a column after the frozen column. Next just move the scrollbar to right and back to the left to recreate the problem.
http://demos.telerik.com/aspnet-ajax/grid/examples/generalfeatures/frozencolumns/defaultcs.aspx