<
telerik:RadComboBox
ID
=
"ddlProject"
runat
=
"server"
Height
=
"190px"
Skin
=
"Outlook"
DataValueField
=
"Project_ID"
AutoPostBack
=
"true"
Width
=
"500px"
AllowCustomText
=
"True"
ShowToggleImage
=
"True"
EmptyMessage
=
"Choose Project Name"
ShowMoreResultsBox
=
"true"
EnableLoadOnDemand
=
"True"
MarkFirstMatch
=
"True"
HighlightTemplatedItems
=
"true"
OnItemsRequested
=
"ddlProject_ItemsRequested"
EnableVirtualScrolling
=
"true"
>
<
HeaderTemplate
>
<
table
class
=
"style1"
>
<
tr
>
<
td
width
=
"50%"
>
Customer Name
</
td
>
<
td
width
=
"30%"
>
Project Name
</
td
>
</
tr
>
</
table
>
</
HeaderTemplate
>
<
ItemTemplate
>
<
table
class
=
"style1"
>
<
tr
>
<
td
width
=
"50%"
>
<%# DataBinder.Eval(Container.DataItem, "ModelCustomer.Customer_Name")%>
</
td
>
<
td
width
=
"30%"
>
<%# DataBinder.Eval(Container.DataItem, "Project_Name") %>
</
td
>
</
tr
>
</
table
>
</
ItemTemplate
>
</
telerik:RadComboBox
>
protected
void
RadScheduler1_ResourcesPopulating(
object
sender, ResourcesPopulatingEventArgs e)
// Description: this methods initializes the extended properties of the scheduling information.
{
String aux = System.Web.HttpContext.Current.Session[
"ClubId"
].ToString();
Int16 clubId = Convert.ToInt16(aux);
e.SchedulerInfo =
new
SchedulerInfoExt(e.SchedulerInfo, clubId, System.Web.HttpContext.Current.Session[
"ResourceType"
].ToString());
}
My requirements are as follows:
A grid with inline add capability.
A column with delete capability.
No edit capability. In line or otherwise.
My problem is twofold. One it seems the only way to get the Insert/Cancel buttons to show up on inline add is to have an edit column defined. If this is not accurate please let me know.
The second problem is once I have a edit column the add works. But I do not want to edit. I have figured out how to hide the edit button but an empty column doesn't satisfy the customer either.
I have figured out how to direct the edit column to my delete function.... but my only problem remaining is I cannot change the edit pencil sprite to be the delete X sprite or delete Trashcan sprite.. In fact what I get is both icons overlaid on top of one another. Perhaps there is a property I am unaware of to remove the edit pencil image?
Please help with either how to get the correct image to display in my hijacked edit column or if there is a simpler approach to meet my requirements that I am unaware of.
Here is my code:
<
telerik:RadGrid
ID
=
"Grid"
runat
=
"server"
AutoGenerateColumns
=
"False"
CellSpacing
=
"0"
GridLines
=
"None"
Skin
=
"Outlook"
OnNeedDataSource
=
"GetDataSource"
AllowAutomaticDeletes
=
"True"
AllowAutomaticInserts
=
"True"
OnItemCommand
=
"GridOnCommand"
OnPreRender
=
"GridPreRender"
>
<
MasterTableView
IsFilterItemExpanded
=
"True"
CommandItemDisplay
=
"Top"
EditMode
=
"InPlace"
>
<
CommandItemSettings
ShowAddNewRecordButton
=
"true"
AddNewRecordText
=
"Add Record"
/>
<
RowIndicatorColumn
FilterControlAltText
=
"Filter RowIndicator column"
>
</
RowIndicatorColumn
>
<
ExpandCollapseColumn
FilterControlAltText
=
"Filter ExpandColumn column"
>
</
ExpandCollapseColumn
>
<
Columns
>
<
telerik:GridBoundColumn
FilterControlAltText
=
"Filter Col1 column"
HeaderText
=
"Col1"
UniqueName
=
"Col1"
DataField
=
"Col1"
>
</
telerik:GridBoundColumn
>
<
telerik:GridBoundColumn
FilterControlAltText
=
"Filter Col2 column"
HeaderText
=
"Col2"
UniqueName
=
"Col2"
DataField
=
"Col2"
>
</
telerik:GridBoundColumn
>
<
telerik:GridBoundColumn
FilterControlAltText
=
"Filter Col3 column"
HeaderText
=
"Col3"
UniqueName
=
"Col3"
DataField
=
"Col3"
>
</
telerik:GridBoundColumn
>
<
telerik:GridBoundColumn
FilterControlAltText
=
"Filter Col4 column"
HeaderText
=
"Col4"
UniqueName
=
"Col3"
DataField
=
"Col4"
>
</
telerik:GridBoundColumn
>
<
telerik:GridEditCommandColumn
ButtonType
=
"ImageButton"
UniqueName
=
"EditColumn"
>
</
telerik:GridEditCommandColumn
>
</
Columns
>
</
MasterTableView
>
</
telerik:RadGrid
>
Code Behind:
protected
void
GridPreRender(
object
sender, EventArgs e)
{
foreach
(GridDataItem item
in
Grid.MasterTableView.Items)
{
ImageButton btn = (ImageButton)item[
"EditColumn"
].Controls[0];
btn.CommandName =
"Delete"
;
btn.CssClass =
"rgDel"
;
btn.ToolTip =
"Delete"
;
}
}