I am trying to get a gridview to display a clickable icon that shows the current status of the gridview item which can be sorted and filtered. When clicked the status image should toggle between active / Inactive / Unknown images and update the appropriate item's status in the DB(immediately or after a save changes button is pressed, either way). The DB stores the status as an int where 0 = inactive, 1 = active, and any other number is unknown. The radGrid uses an objectDataSource to access the DB which contains the int as 'Status'.
I tried to use an itemTemplate With a radButton with a buttonType of ToggleButton, a ToggleType of CustomToggle And three toggleStates (one for each status), while the toggling between the images worked, I can't seem to bind original(default) toggleState to the 'Status' value, and being able to sort/filter based on that.
.aspx:
Any Help would be Great
I tried to use an itemTemplate With a radButton with a buttonType of ToggleButton, a ToggleType of CustomToggle And three toggleStates (one for each status), while the toggling between the images worked, I can't seem to bind original(default) toggleState to the 'Status' value, and being able to sort/filter based on that.
.aspx:
01.
<
telerik:RadGrid
ID
=
"InvQryList"
runat
=
"server"
AllowFilteringByColumn
=
"True"
02.
AllowSorting
=
"True"
AutoGenerateDeleteColumn
=
"True"
DataSourceID
=
"InvQryDS"
03.
Skin
=
"Windows7"
>
04.
<
ClientSettings
EnableRowHoverStyle
=
"True"
>
05.
</
ClientSettings
>
06.
<
MasterTableView
AutoGenerateColumns
=
"False"
DataSourceID
=
"InvQryDS"
FilterExpression
=
"(it.Active != 0)"
>
07.
<
Columns
>
08.
... Other Columns ...
09.
<
telerik:GridTemplateColumn
HeaderText
=
"Active Toggle"
DataField
=
"Active"
>
10.
<
ItemTemplate
>
11.
<
telerik:RadButton
ID
=
"ActiveToggle"
runat
=
"server"
ButtonType
=
"ToggleButton"
ToggleType
=
"CustomToggle"
AutoPostBack
=
"false"
12.
Width
=
"16px"
Height
=
"16px"
>
13.
<
ToggleStates
>
14.
<
telerik:RadButtonToggleState
Value
=
"1"
ImageUrl
=
"img/spheres/green-16x16x32.png"
/>
15.
<
telerik:RadButtonToggleState
Value
=
"0"
ImageUrl
=
"img/spheres/red-16x16x32.png"
/>
16.
<
telerik:RadButtonToggleState
Value
=
"-1"
ImageUrl
=
"img/spheres/grey-16x16x32.png"
/>
17.
</
ToggleStates
>
18.
</
telerik:RadButton
>
19.
</
ItemTemplate
>
20.
</
telerik:GridTemplateColumn
>
21.
</
Columns
>
22.
</
MasterTableView
>
23.
</
telerik:RadGrid
>
Any Help would be Great